AUC: Area Under the ROC Curve

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/AUC.R

Description

This function calculates Area Under the ROC Curve (AUC). The AUC can be defined as the probability that the fit model will score a randomly drawn positive sample higher than a randomly drawn negative sample. This is also equal to the value of the Wilcoxon-Mann-Whitney statistic. This function is a wrapper for functions from the ROCR package.

Usage

1
AUC(predictions, labels, label.ordering = NULL)

Arguments

predictions

A vector of predictions, or predicted probabilities, for each observation.

labels

A binary vector containing the true values for each observation. Must have the same length as predictions.

label.ordering

The default ordering of the classes can be changed by supplying a vector containing the negative and the positive class label (negative label first, positive label second).

Value

The value returned is the Area Under the ROC Curve (AUC).

Author(s)

Erin LeDell oss@ledell.org

References

References to the underlying ROCR code, used to calculate area under the ROC curve, can be found on the ROCR homepage at: https://ipa-tys.github.io/ROCR/

See Also

prediction, performance, cvAUC, ci.cvAUC, ci.pooled.cvAUC

Examples

1
2
3
4
5
6
library(cvAUC)
library(ROCR)  #load example data

data(ROCR.simple)
auc <- AUC(ROCR.simple$predictions, ROCR.simple$labels)
# [1] 0.8341875

ledell/cvAUC documentation built on Jan. 24, 2022, 5:37 p.m.