Introduction to Rating Tables

A rating table is an exportable CSV representation of a Generalized Additive Model. It contains information about the features and coefficients used to make predictions. Users can influence predictions by downloading and editing values in a rating table, then uploading the table and using it to create a new model. See the page about interpreting Generalized Additive Model output in the Datarobot user guide for more details on how to interpret and edit rating tables.

Connect to DataRobot

To explore rating tables, let's first connect to DataRobot. First, you must load the DataRobot R package library.

If you have set up a credentials file, library(datarobot) will initialize a connection to DataRobot automatically. Otherwise, you can specify your endpoint and apiToken as in this example to connect to DataRobot directly. For more information on connecting to DataRobot, see the "Introduction to DataRobot" vignette.

library(datarobot)
endpoint <- "https://<YOUR DATAROBOT URL GOES HERE>/api/v2"
apiToken <- "<YOUR API TOKEN GOES HERE>"
ConnectToDataRobot(endpoint = endpoint, token = apiToken)

Retrieving Rating Tables

You can retrieve a rating table from the list of rating tables in a project:

projectId <- "59dab74bbd2a54035786bfc0"
ratingTables <- ListRatingTables(projectId)
ratingTable <- ratingTables[[1]]
print(ratingTable)
ratingTable <- readRDS("ratingTable.rds")
print(ratingTable)

Or you can retrieve a rating table from a specific model. The model must already have a rating table.

projectId <- "59dab74bbd2a54035786bfc0"
ratingTableModels <- ListRatingTableModels(projectId)
ratingTableModel <- ratingTableModels[[1]]
ratingTableId <- ratingTableModel$ratingTableId
ratingTable <- GetRatingTable(projectId, ratingTableId)
print(ratingTable)
ratingTable <- readRDS("ratingTable.rds")
print(ratingTable)

Or retrieve model by id. The model must have a rating table.

projectId <- "59dab74bbd2a54035786bfc0"
modelId <- "59dd0b01d9575702bec96e4"
ratingTableModel <- GetRatingTableModel(projectId, modelId)
ratingTableId <- ratingTableModel$ratingTableId
ratingTable <- GetRatingTable(projectId, ratingTableId)
print(ratingTable)
ratingTable <- readRDS("ratingTable.rds")
print(ratingTable)

Downloading Rating Tables

Once you have a rating table, you can download the contents to a CSV.

DownloadRatingTable(projectId, ratingTableId, "myRatingTable.csv")

Modifying Rating Tables

You can then modify the values in the CSV and re-upload a new rating table back to DataRobot.

DownloadRatingTable(projectId, ratingTableId, "myRatingTable.csv")
newRatingTableJobId <- CreateRatingTable(project,
                                         modelId,
                                         "myRatingTable.csv",
                                         ratingTableName = "Modified File")
newRatingTable <- GetRatingTableFromJobId(project, newRatingTableJobId)
print(newRatingTable)
ratingTable <- readRDS("ratingTable.rds")
print(ratingTable)

Making New GAMs from New Rating Tables

You can then take the new rating tables you make and create new models from them.

newModelJobId <- RequestNewRatingTableModel(project, newRatingTable)
newRatingTableModel <- GetRatingTableModelFromJobId(project, newModelJobId)
print(newRatingTableModel)
newRatingTableModel <- readRDS("ratingTableModel.RDS")
print(newRatingTableModel)


Try the datarobot package in your browser

Any scripts or data that you put into this service are public.

datarobot documentation built on June 2, 2021, 9:06 a.m.