Learn R Programming

datarobot (version 2.8.0)

GetReasonCodesRows: Retrieve all reason codes rows

Description

Retrieve all reason codes rows

Usage

GetReasonCodesRows(project, reasonCodeId, batchSize = NULL,
  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.

batchSize

integer. Optional. Maximum number of reason codes rows to retrieve per request

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

list of raw reason codes, each element corresponds to a row of the prediction dataset

  • rowId. Character string row Id.

  • prediction. prediction for the row.

  • predictionValues. list containing

    • label. describes what this model output corresponds to. For regression projects, it is the name of the target feature. For classification projects, it is a level from the target feature.

    • value. the output of the prediction. For regression projects, it is the predicted value of the target. For classification projects, it is the predicted probability the row belongs to the class identified by the label.

  • adjustedPrediction. adjusted predictions, if they are not excluded.

  • adjustedPredictionValues. Similar to predictionValues, but for adjusted predictions, if they are not excluded.

  • reasonCodes. list contaning

    • label. described what output was driven by this reason code. For regression projects, it is the name of the target feature. For classification projects, it is

    • feature. the name of the feature contributing to the prediction.

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

    • strength. the amount this feature's value affected the prediction

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

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)
  GetReasonCodesRows(projectId, reasonCodeId)
# }

Run the code above in your browser using DataLab