ROC Curve & AUC

Computes the ROC curve (Receiver Operating Characteristic) and the Area Under the Curve (AUC) for binary classification.

Statusvalidated
Version1.0.0
Minitab equivalentStat > Regression > Binary Logistic Regression > ROC Curve

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

TPR (Sensitivity)
True Positive Rate (Sensitivity): proportion of correctly identified positive cases
FPR (1 − Specificity)
False Positive Rate (1 − Specificity): proportion of negative cases incorrectly classified as positive
AUC (trapezoidal)
Area Under the ROC Curve, computed using the trapezoidal rule
Perfect classifier
A perfect classifier achieves AUC = 1.0 (complete class separation)
Random classifier
A random classifier achieves AUC = 0.5 (ROC curve on the diagonal)

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