Learn R Programming

datarobot (version 2.14.2)

GetAllReasonCodesRowsAsDataFrame: Retrieve all reason codes rows and return them as a data frame (deprecated)

Description

Use GetPredictionExplanationsRowsAsDataFrame instead.

Usage

GetAllReasonCodesRowsAsDataFrame(project, reasonCodeId,
  excludeAdjustedPredictions = TRUE)

Arguments

project

character. Either (1) a character string giving the unique alphanumeric identifier for the project, or (2) a list containing the element projectId with this identifier.

reasonCodeId

character. id of the reason codes.

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 colums:

  • rowId. Integer row id from prediction dataset.

  • prediction. Numeric the output of the model for this row (numric prediction for regression problem, predicted class for classification problem).

  • class1Label. Character string Label of class 0. Available only for classification problem.

  • class1Probability. Numeric Predicted probability of class 0. Available only for classification problem.

  • class2Label. Character string Label of class 1. Available only for classification

  • class2Probability. Numeric Predicted probability of class 1. Available only for classification problem.

  • reason1FeatureName. Character string the name of the feature contributing to the prediction.

  • reason1FeatureValue. the value the feature took on for this row.

  • reason1QualitativeStrength. Numeric how strongly the feature affected the prediction.

  • reason1Strength. Character string a human-readable description of how strongly the feature affected the prediction (e.g. '+++', '--', '+').

  • reason1Label. Character string describes what output was driven by this reason code. For regression projects, it is the name of the target feature. For classification projects, it is theclass whose probability increasing would correspond to a positive strength of this.

  • reasonNFeatureName. Character string the name of the feature contributing to the prediction.

  • reasonNFeatureValue. the value the feature took on for this row.

  • reasonNQualitativeStrength. Numeric how strongly the feature affected the prediction.

  • reasonNStrength. Character string a human-readable description of how strongly the feature affected the prediction (e.g. '+++', '--', '+').

  • reasonNLabel. Character string describes what output was driven by this reason code. For regression projects, it is the name of the target feature. For classification projects, it is theclass whose probability increasing would correspond to a positive strength of this.

  • reasonNFeatureName. Character string the name of the feature contributing to the prediction.

Examples

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

Run the code above in your browser using DataLab