AUC | R Documentation |
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.
AUC(predictions, labels, label.ordering = NULL)
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 |
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). |
The value returned is the Area Under the ROC Curve (AUC).
Erin LeDell oss@ledell.org
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/
prediction
, performance
, cvAUC
, ci.cvAUC
, ci.pooled.cvAUC
library(cvAUC) library(ROCR) #load example data data(ROCR.simple) auc <- AUC(ROCR.simple$predictions, ROCR.simple$labels) # [1] 0.8341875
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.