Get Distance Cutoffs
get-cutoffs.RdFor given true class names and predictions, calculate the maximal perpendicular distance to the unit line, its corresponding specificity, then the cutoff corresponding to that specificity.
For a given specificity, calculate the corresponding cutoff (operating point) from a set of predictions.
Usage
get_max_cutoff(truth, predicted, pos_class)
get_spec_cutoff(truth, predicted, spec, pos_class)Arguments
- truth
character(n)orfactor(n). A vector of true class names. In most instances you will have to also pass apos_classargument defining the positive/event class.- predicted
numeric(n). A numeric vector of class probabilities.- pos_class
character(1). Name of the "positive" or "event" class.- spec
numeric(1). The desired specificity.
Value
get_max_cutoff(): a numeric cutoff representing
the operating point at the maximal perpendicular distance
from the unit line.
get_spec_cutoff(): a numeric cutoff representing
the operating point for a given specificity.