GetPredictionExplanations {datarobot}R Documentation

Get prediction explanations

Description

A streamlined workflow to both generate and retrieve prediction explanations for a model.

Usage

GetPredictionExplanations(
  model,
  dataset,
  maxExplanations = NULL,
  thresholdLow = NULL,
  thresholdHigh = NULL,
  batchSize = NULL,
  maxWait = 600,
  excludeAdjustedPredictions = TRUE
)

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.

dataset

object. Either (1) the prediction dataset object of class dataRobotPredictionDataset, (2) a data.frame containing the prediction data, (3) the datasetID of the prediction dataset, (4) a file path to the data, or (5) a URL to the data. References the dataset of predictions used to get prediction explanations for.

maxExplanations

integer. Optional. The maximum number of prediction explanations to supply per row of the dataset, default: 3.

thresholdLow

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

thresholdHigh

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

batchSize

integer. Optional. Maximum number of prediction explanations rows to retrieve per request

maxWait

integer. The maximum time (in seconds) to wait for the model job to complete.

excludeAdjustedPredictions

logical. Optional. Set to FALSE to include adjusted predictions, which are predictions adjusted by an exposure column. This is only relevant for projects that use an exposure column.

Value

data frame with following columns:

Examples

## Not run: 
  projectId <- "59a5af20c80891534e3c2bde"
  modelId <- "5996f820af07fc605e81ead4"
  datasets <- ListPredictionDatasets(projectId)
  dataset <- datasets[[1]]
  model <- GetModel(projectId, modelId)
  GetPredictionExplanations(model, dataset)

## End(Not run)

[Package datarobot version 2.18.6 Index]