A binary classifier outputs predicted probabilities [0.90,0.80,0.70,0.60,0.40,0.20] for six test examples with true labels [1,0,1,1,0,0]. What are the (FPR,TPR) points on the ROC curve, and what is the exact ROC-AUC?

ML systems and evaluation, Classification metrics
Level L2 Elementary. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can sweep a decision threshold to trace an ROC curve and compute ROC-AUC both geometrically and via concordant pairs.

Key idea

Lowering the threshold from 1 to 0 moves through the sorted scores, stepping up in true positive rate TPR=TP/P when a positive is included and right in false positive rate FPR=FP/N when a negative is included (where TP and FP count true and false positives, and P and N are total positives and negatives); the area under this staircase equals the fraction of positive–negative pairs ranked in the right order.

Steps

  1. Count positives P=3 and negatives N=3. Start at threshold >0.90 with (FPR,TPR)=(0,0).
  2. Sweep the threshold τ down across each score (predicting positive when score ≥τ): at τ=0.90, (0,1/3); at τ=0.80, (1/3,1/3); at τ=0.70, (1/3,2/3); at τ=0.60, (1/3,1); at τ=0.40, (2/3,1); at τ=0.20, (1,1).
  3. Compute the area under the step curve: from FPR=0 to 1/3, height is 1/3, giving 13×13=19; from FPR=1/3 to 1, height is 1, giving 23×1=69.
  4. Sum the regions: ROC-AUC=19+69=79≈0.778.
  5. Verify with pairwise concordance over the 3×3=9 positive–negative pairs: the 0.90 positive beats all 3 negatives, while the 0.70 and 0.60 positives each beat 2 negatives (0.40 and 0.20), giving (3+2+2)/9=7/9.

Common mistakes

How long your answer should be

List of 7 ROC points and four lines of arithmetic; 3–4 minutes.

Last checked on 4 December 2026.

Read this

Previous in ML systems and evaluation: What does it mean for a classifier to be calibrated? Compute the expected calibration error (ECE) for two confidence bins: 60 predictions with mean confidence 0.9 and accuracy 0.75, and 40 predictions with mean confidence 0.6 and accuracy 0.55. How does temperature scaling fix miscalibration?
Next in ML systems and evaluation: A disease screening model tested on 200 patients produces TP=36, FN=4, FP=24 and TN=136. What are precision, recall, F1 and F2, and why does a screening task favour β>1?