
Last chance! 50% off unlimited learning
Sale ends in
There are some groups of columns whose appearance depends on the exact contents of the project dataset. For classification projects, columns "classNLabel", 'classNProbability", "classNLabel", "classNProbability" will appear corresponding to each class within the target; these columns will not appear for regression projects. Columns like "reasonNLabel" will appear corresponding to each included reason code in the row. In both cases, the value of N will start at 1 and count up.
GetAllReasonCodesRowsAsDataFrame(project, reasonCodeId,
excludeAdjustedPredictions = TRUE)
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.
character. id of the reason codes.
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 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.
# 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