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.
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.
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)
$validationJobId NULL
$validationError [1] “”
$projectId [1] “59dab74bbd2a54035786bfc0”
$ratingTableName [1] “Rating Table for 59dab774bd2a54035d157fa7”
$parentModelId [1] “59dab774bd2a54035d157fa7”
$modelJobId NULL
$id [1] “59dab7a06f42a6df428bc14c”
$originalFilename [1] “rating_table.csv”
$modelId [1] “59dab774bd2a54035d157fa7”
attr(,“class”) [1] “dataRobotRatingTable”
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)
$validationJobId NULL
$validationError [1] “”
$projectId [1] “59dab74bbd2a54035786bfc0”
$ratingTableName [1] “Rating Table for 59dab774bd2a54035d157fa7”
$parentModelId [1] “59dab774bd2a54035d157fa7”
$modelJobId NULL
$id [1] “59dab7a06f42a6df428bc14c”
$originalFilename [1] “rating_table.csv”
$modelId [1] “59dab774bd2a54035d157fa7”
attr(,“class”) [1] “dataRobotRatingTable”
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)
$validationJobId NULL
$validationError [1] “”
$projectId [1] “59dab74bbd2a54035786bfc0”
$ratingTableName [1] “Rating Table for 59dab774bd2a54035d157fa7”
$parentModelId [1] “59dab774bd2a54035d157fa7”
$modelJobId NULL
$id [1] “59dab7a06f42a6df428bc14c”
$originalFilename [1] “rating_table.csv”
$modelId [1] “59dab774bd2a54035d157fa7”
attr(,“class”) [1] “dataRobotRatingTable”
Once you have a rating table, you can download the contents to a CSV.
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)
$validationJobId NULL
$validationError [1] “”
$projectId [1] “59dab74bbd2a54035786bfc0”
$ratingTableName [1] “Rating Table for 59dab774bd2a54035d157fa7”
$parentModelId [1] “59dab774bd2a54035d157fa7”
$modelJobId NULL
$id [1] “59dab7a06f42a6df428bc14c”
$originalFilename [1] “rating_table.csv”
$modelId [1] “59dab774bd2a54035d157fa7”
attr(,“class”) [1] “dataRobotRatingTable”
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)
$featurelistId [1] “59dd4731c0d33327b8f55610”
$processes [1] “One-Hot Encoding”
[2] “Ordinal encoding of categorical variables”
[3] “Missing Values Imputed”
[4] “Matrix of word-grams occurrences”
[5] “Generalized Additive Model”
[6] “Text fit on Residuals (L2 / Binomial Deviance)”
$featurelistName [1] “Informative Features”
$projectId [1] “59dd4723d957570407bc37b4”
$modelType [1] “Generalized Additive Model”
$samplePct [1] 64.041
$isFrozen [1] FALSE
metricsmetricsAUCmetricsAUCbacktesting NULL
metricsAUC$holdout NULL
metricsAUC$backtestingScores NULL
metricsAUC$crossValidation NULL
metricsAUC$validation [1] 0.77283
metricsRate@Top5%
metricsRate@Top5%
$backtesting
NULL
metricsRate@Top5%
$holdout
NULL
metricsRate@Top5%
$backtestingScores
NULL
metricsRate@Top5%
$crossValidation
NULL
metricsRate@Top5%
$validation
[1] 1
metricsRate@TopTenth%
metricsRate@TopTenth%
$backtesting
NULL
metricsRate@TopTenth%
$holdout
NULL
metricsRate@TopTenth%
$backtestingScores
NULL
metricsRate@TopTenth%
$crossValidation
NULL
metricsRate@TopTenth%
$validation
[1] 1
metricsRMSE metricsRMSE$backtesting NULL
metricsRMSE$holdout NULL
metricsRMSE$backtestingScores NULL
metricsRMSE$crossValidation NULL
metricsRMSE$validation [1] 0.41992
metricsLogLoss metricsLogLoss$backtesting NULL
metricsLogLoss$holdout NULL
metricsLogLoss$backtestingScores NULL
metricsLogLoss$crossValidation NULL
metricsLogLoss$validation [1] 0.50643
metricsFVE Binomial
metricsFVE Binomial
$backtesting
NULL
metricsFVE Binomial
$holdout
NULL
metricsFVE Binomial
$backtestingScores
NULL
metricsFVE Binomial
$crossValidation
NULL
metricsFVE Binomial
$validation
[1] 0.23955
metricsGini Norm
metricsGini Norm
$backtesting
NULL
metricsGini Norm
$holdout
NULL
metricsGini Norm
$backtestingScores
NULL
metricsGini Norm
$crossValidation
NULL
metricsGini Norm
$validation
[1] 0.54566
metricsRate@Top10%
metricsRate@Top10%
$backtesting
NULL
metricsRate@Top10%
$holdout
NULL
metricsRate@Top10%
$backtestingScores
NULL
metricsRate@Top10%
$crossValidation
NULL
metricsRate@Top10%
$validation
[1] 1
$modelCategory [1] “model”
$blueprintId [1] “24ea7590216323555b8fe51fe006dfba”
$ratingTableId [1] “59dd4778e643feefd5d87c9b”
$id [1] “59dd474bd95757040120a8e8”
attr(,“class”) [1] “dataRobotRatingTableModel”