A binary classifier outputs predicted probabilities for six test examples with true labels . What are the 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 to moves through the sorted scores, stepping up in true positive rate when a positive is included and right in false positive rate when a negative is included (where and count true and false positives, and and are total positives and negatives); the area under this staircase equals the fraction of positive–negative pairs ranked in the right order.
Steps
- Count positives and negatives . Start at threshold with .
- Sweep the threshold down across each score (predicting positive when score ): at , ; at , ; at , ; at , ; at , ; at , .
- Compute the area under the step curve: from to , height is , giving ; from to , height is , giving .
- Sum the regions: .
- Verify with pairwise concordance over the positive–negative pairs: the positive beats all negatives, while the and positives each beat negatives ( and ), giving .
Common mistakes
- Dividing by the total sample size instead of and separately when computing and .
- Forgetting to count tied scores as in the pairwise formula (or connecting tied points diagonally in the trapezoidal rule) when ties occur.
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 , , and . What are precision, recall, and , and why does a screening task favour ?