auc: Area Under the ROC Curve

Description Usage Arguments Value Meta Information Note References See Also Examples

View source: R/binary_auc.R

Description

Computes the area under the Receiver Operator Characteristic (ROC) curve. The AUC can be interpreted as the probability that a randomly chosen positive observation has a higher predicted probability than a randomly chosen negative observation.

Usage

1
auc(truth, prob, positive, na_value = NaN, ...)

Arguments

truth

:: factor()
True (observed) labels. Must have the exactly same two levels and the same length as response.

prob

:: numeric()
Predicted probability for positive class. Must have exactly same length as truth.

positive

:: character(1)
Name of the positive class.

na_value

:: numeric(1)
Value that should be returned if the measure is not defined for the input (as described in the note). Default is NaN.

...

:: any
Additional arguments. Currently ignored.

Value

Performance value as numeric(1).

Meta Information

Note

This measure is undefined if the true values are either all positive or all negative.

References

youden_1950

See Also

Other Binary Classification Measures: dor, fbeta, fdr, fnr, fn, fomr, fpr, fp, mcc, npv, ppv, tnr, tn, tpr, tp

Examples

1
2
3
truth = factor(c("a", "a", "a", "b"))
prob = c(.6, .7, .1, .4)
auc(truth, prob, "a")

mlr3measures documentation built on Nov. 5, 2019, 9:06 a.m.