setThreshold: Set a threshold in a caret model

View source: R/predict2.R

setThresholdR Documentation

Set a threshold in a caret model

Description

This function will set a probability threshold cutoff to be used in predictions in a two class Classification problem. This threshold is automatically read by predict2 and other functions in this package when calculating new predictions.

Usage

setThreshold(model, thr)

Arguments

model

A model returned by train.

thr

A value between 0 and 1 to be used as a threshold or the output of summary.thresholder2().

Value

The caret model provided with a new item thr and the pred data.frame updated, if it exists. If "thr" is a 'data.frame', the finalModel is also updated using new parameters provided.

Note

Objects results and resample remain unchanged. Use evaluate to obtain corrected statistics based on the new threshold.

See Also

predict2 update.train


correapvf/caretSDM documentation built on June 2, 2022, 8:29 a.m.