roc: Calculate a ROC curve.

Description Usage Arguments Value Examples

Description

Calculates a maximum-resolution Receiver Operating Characteristic (ROC) curve (considering all possible thresholds). Note that tied values are correctly handled, which is one point of pedantry many other implementations fail to satisfy.

Usage

1
roc(y, classes)

Arguments

y

A numeric vector, high values of which are assumed to predict class TRUE.

classes

A boolean vector of the same length as y, corresponding to the known classes.

Value

A data.frame representing the ROC curve for the classifier y >= t for all possible values of the threshold t. Rows represent each unique point on this ROC curve, with columns for the respective FPR and TPR of each point. Each such point corresponds to an interval of threshold values, and a third column, t, returns the largest value of t on the closure of the corresponding interval. Note that:

Examples

1
roc(c(1, 2, 3, 4, 4, 5), c(FALSE, FALSE, FALSE, TRUE, FALSE, TRUE))

Armadilloa16/roc documentation built on May 5, 2019, 7:06 a.m.