What is a ROC Curve?

A ROC curve plots the performance of a binary classification model at all classification thresholds. It shows the trade-off between sensitivity and specificity.

X-axis: False Positive Rate (FPR)
Y-axis: True Positive Rate (TPR)
TPR = TP / (TP + FN) = Sensitivity
FPR = FP / (FP + TN) = 1 - Specificity

AUC (Area Under Curve) summarizes the entire ROC curve into a single number between 0 and 1.

One model, many thresholds

Move the threshold to see which examples are called positive. The model scores stay fixed; only the decision rule changes.

ROC curve for ten synthetic examples The horizontal axis is false positive rate and the vertical axis is true positive rate, both from zero to one. The solid staircase shows the model across thresholds. The outlined dot marks the selected threshold; exact rates and counts appear below. False positive rate True positive rate 0 0.5 1 0 0.5 1
Model (AUC 0.84)Random ranking (0.5)

Call an example positive when its score ≥ threshold. Use arrow keys for steps of 0.05; Home / End select the extremes.

True positives (TP)
4 / 5
False positives (FP)
2 / 5
False negatives (FN)
1 / 5
True negatives (TN)
3 / 5

Try 1.00, then lower the threshold: more positives are found, but more negatives are flagged too. The dot moves along the curve; AUC stays fixed.

Inspect the synthetic examples

Five actual positives: 0.95, 0.85, 0.75, 0.55, 0.35.
Five actual negatives: 0.80, 0.50, 0.30, 0.20, 0.10.

Scores are illustrative, not calibrated probabilities. Each vertical step adds one true positive; each horizontal step adds one false positive. A positive outranks a negative in 21 of 25 pairs, so AUC = 0.84.