Learn R Programming

datarobot (version 2.8.0)

RequestReasonCodes: Request reason codes computation for a specified model and dataset.

Description

In order to create ReasonCodes for a particular model and dataset, you must first: Compute feature impact for the model via RequestFeatureImpact() Compute a ReasonCodesInitialization for the model via RequestReasonCodesInitialization() Compute predictions for the model and dataset via RequestPredictionsForDataset() After reason codes are requested information about them can be accessed using the functions GetReasonCodesMetadataFromJobId and GetReasonCodesMetadata And reason codes themselves can be accessed using the functions GetReasonCodesRows, GetAllReasonCodesRowsAsDataFrame, DownloadReasonCodes

Usage

RequestReasonCodes(model, datasetId, maxCodes = NULL, thresholdLow = NULL,
  thresholdHigh = NULL)

Arguments

model

An S3 object of class dataRobotModel like that returned by the function GetModel, or each element of the list returned by the function ListModels.

datasetId

Character string. Id of the prediction dataset for which reason codes are requested

maxCodes

integer (optional) The maximum number of reason codes to supply per row of the dataset, default: 3.

thresholdLow

numeric (optional) The lower threshold, below which a prediction must score in order for reason codes to be computed for a row in the dataset. If neither threshold_high nor threshold_low is specified, reason codes will be computed for all rows.

thresholdHigh

numeric (optional) The high threshold, above which a prediction must score in order for reason codes to be computed. If neither threshold_high nor threshold_low is specified, reason codes will be computed for all rows.

Value

job Id

Details

threshold_high and threshold_low are optional filters applied to speed up computation. When at least one is specified, only the selected outlier rows will have reason codes computed. Rows are considered to be outliers if their predicted value (in case of regression projects) or probability of being the positive class (in case of classification projects) is less than threshold_low or greater than thresholdHigh. If neither is specified, reason codes will be computed for all rows.

Examples

Run this code
# NOT RUN {
  projectId <- "59a5af20c80891534e3c2bde"
  modelId <- "5996f820af07fc605e81ead4"
  datasets <- ListPredictionDatasets(projectId)
  dataset <- datasets[[1]]
  datasetId <- dataset$id
  model <- GetModel(model, datasetId)
  RequestReasonCodes(model, datasetId)
# }

Run the code above in your browser using DataLab