Skip to content
EvalSuite
Documentation menu

Classification

ROC AUC

Implementedclassification.roc_auc

Definition

Area under the receiver operating characteristic curve; the probability that a random positive is ranked above a random negative.

Formula

AUC = ∫₀¹ TPR(FPR) dFPR

Range: [0, 1]

Inputs and outputs

  • y_true: array of binary labels {0, 1}
  • y_prob: predicted probability of the positive class in [0, 1]

Returns: float

Assumptions

  • Requires both classes to be present in y_true.

Limitations

  • Insensitive to calibration.
  • Can look optimistic on heavily imbalanced data; consider PR AUC alongside it.

Python API

PythonSince v0.1.0
import evalsuite as es

es.roc_auc(y_true, y_prob)

References

  1. Hanley, J. A., & McNeil, B. J. (1982). The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology, 143(1), 29–36.
  2. Fawcett, T. (2006). An introduction to ROC analysis. Pattern Recognition Letters, 27(8), 861–874.

Implementation status