Learn R Programming

datarobot (version 2.18.6)

SetPredictionThreshold: Set a custom prediction threshold for binary classification models.

Description

The prediction threshold is used by a binary classification model when deciding between the positive and negative class.

Usage

SetPredictionThreshold(model, threshold)

Value

Returns NULL but updates the model in place.

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.

threshold

numeric. The threshold to use when deciding between the positive and negative class. Should be between 0 and 1 inclusive.

Details

Note: This feature can only can be used when PredictionThresholdReadOnly is FALSE. Models typically cannot have their prediction threshold modified if they have been used to set a deployment or predictions have been made with the dedicated prediction API.

Examples

Run this code
if (FALSE) {
  projectId <- "59a5af20c80891534e3c2bde"
  modelId <- "5996f820af07fc605e81ead4"
  model <- GetModel(projectId, modelId)
  SetPredictionThreshold(model, threshold = 0.6)
}

Run the code above in your browser using DataLab