ROC Curve & AUC
Computes the ROC curve (Receiver Operating Characteristic) and the Area Under the Curve (AUC) for binary classification.
Description
The ROC curve plots True Positive Rate (sensitivity) against False Positive Rate (1 − specificity) across all possible decision thresholds. The AUC summarises classifier discrimination in a single metric: AUC = 1.0 indicates a perfect classifier, AUC = 0.5 a random one. Computation uses the trapezoidal rule over sorted thresholds.
Formulas
Assumptions
- Binary classification with labels 0 and 1
- Probabilities represent posterior P(Y=1|X)
- Higher probability indicates the positive class
- Observations are independent
Limitations
- Tied probabilities can affect curve shape
- AUC is insensitive to calibration (only rank-based)
- A single AUC value may mislead with class imbalance — inspect the full curve
- All-positive or all-negative Y defaults to AUC = 0.5
References
- Fawcett, T., An Introduction to ROC Analysis, Pattern Recognition Letters, 2006
- Hosmer, D.W., Lemeshow, S., Applied Logistic Regression, 3rd Ed., Wiley, Ch. 5
- Hanley, J.A., McNeil, B.J., The Meaning and Use of the Area under a ROC Curve, Radiology, 1982