← AI Terminology

ROC Curve

An ROC curve (Receiver Operating Characteristic curve) is a graph that plots the true positive rate (recall) against the false positive rate at all possible classification thresholds — providing a visual summary of a binary classifier's discrimination ability across the full range of operating points.

The area under the ROC curve (AUC-ROC) is the primary metric for comparing classifier quality.
Why It Matters in AI
A single accuracy or F1 score is insufficient for evaluating a classifier: it depends on the threshold chosen. The ROC curve shows performance across all thresholds — revealing whether a model is fundamentally good at separating classes or just well-tuned. AUC-ROC has a clear interpretation: the probability that the model ranks a random positive example higher than a random negative example. AUC = 0.5 is random; AUC = 1.0 is perfect; AUC > 0.9 is excellent for most applications.
Key Points
Aspect Description
vs PRC For imbalanced datasets, Precision-Recall Curve (PRC) is more informative than ROC
AUC-ROC Area under the ROC curve — [0, 1]; 0.5 = random; 1.0 = perfect; ≥ 0.9 = excellent
Diagonal AUC = 0.5: curve runs along the diagonal — random classifier, no discrimination ability
FPR (x-axis) False Positive Rate = FP / (FP + TN) — fraction of negatives incorrectly flagged as positive
TPR (y-axis) True Positive Rate = Recall = TP / (TP + FN) — fraction of positives correctly identified
Operating point Choose threshold on the curve that meets application requirements (e.g. TPR > 0.95)
Simple Analogy
A fishing net of adjustable mesh size: a coarse mesh catches everything (high TPR, high FPR); a fine mesh catches few fish but no debris (low FPR, low TPR). The ROC curve plots every mesh size — the AUC summarises how well the net separates fish from debris across all sizes.
Common Usage Examples
  • fpr, tpr, thresholds = sklearn.metrics.roc_curve(y_true, y_scores)
  • auc = sklearn.metrics.roc_auc_score(y_true, y_scores) — single AUC value
  • sklearn.metrics.RocCurveDisplay.from_predictions(y_true, y_scores).plot() — plot ROC curve
  • Medical AI: radiologist AI must achieve AUC ≥ 0.95 for FDA clearance on screening tasks
  • Imbalanced fraud: prefer average_precision_score (PRC AUC) over ROC AUC when positives are <1%
Summary
In short: The ROC curve plots a classifier's tradeoff between catching positives and false alarms across all thresholds — the AUC score summarises this into a single number representing the model's fundamental discrimination ability, independent of any threshold choice.