View source: R/PredictionExplanations.R
GetPredictionExplanations | R Documentation |
A streamlined workflow to both generate and retrieve prediction explanations for a model.
GetPredictionExplanations(
model,
dataset,
maxExplanations = NULL,
thresholdLow = NULL,
thresholdHigh = NULL,
batchSize = NULL,
maxWait = 600,
excludeAdjustedPredictions = TRUE
)
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
|
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 |
thresholdHigh |
numeric. Optional. The high threshold, above which a prediction must score
in order for prediction explanations to be computed. If neither |
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. |
data frame with following columns:
rowId integer. Row id from prediction dataset.
prediction numeric. The output of the model for this row (numeric prediction for regression problem, predicted class for classification problem).
class1Label character. Label of class 0. Available only for classification problem.
class1Probability numeric. Predicted probability of class 0. Available only for classification problem.
class2Label character. Label of class 1. Available only for classification problem.
class2Probability numeric. Predicted probability of class 1. Available only for classification problem.
explanation1FeatureName character. The name of the feature contributing to the prediction.
explanation1FeatureValue character. the value the feature took on for this row.
explanation1QualitativeStrength numeric. How strongly the feature affected the prediction.
explanation1Strength character. A human-readable description of how strongly the feature affected the prediction (e.g. '+++', '–', '+').
explanation1Label character. Describes what output was driven by this prediction explanation. For regression projects, it is the name of the target feature. For classification projects, it is the class whose probability increasing would correspond to a positive strength of this.
explanationNFeatureName character. The name of the feature contributing to the prediction.
explanationNFeatureValue character. The value the feature took on for this row.
explanationNQualitativeStrength numeric. How strongly the feature affected the prediction.
explanationNStrength character. A human-readable description of how strongly the feature affected the prediction (e.g. '+++', '–', '+').
explanationNLabel character. Describes what output was driven by this prediction explanation. For regression projects, it is the name of the target feature. For classification projects, it is the class whose probability increasing would correspond to a positive strength of this.
explanationNFeatureName. Character string the name of the feature contributing to the prediction.
## Not run:
projectId <- "59a5af20c80891534e3c2bde"
modelId <- "5996f820af07fc605e81ead4"
datasets <- ListPredictionDatasets(projectId)
dataset <- datasets[[1]]
model <- GetModel(projectId, modelId)
GetPredictionExplanations(model, dataset)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.