Evaluation
ROC, Precision–Recall Curves, AUC, and Discrimination
Interpret ROC and precision–recall curves, understand AUC as a ranking summary, and avoid using threshold-free metrics as deployment decisions.
By the end you can
- Construct ROC and precision–recall curves from threshold sweeps
- Interpret ROC AUC and average precision as ranking summaries
- Explain why class prevalence affects precision–recall curves
- Choose partial curves and operating regions that match deployment
A threshold-free score still encodes a weighting policy
ROC AUC averages ranking behavior across false-positive rates that may never be operationally acceptable. Average precision emphasizes positive retrieval across recall increments, but its baseline depends on prevalence. Curves are valuable because they show tradeoffs across thresholds. They do not select the threshold or determine which tradeoffs matter.
What the area means is old and exact. It was fixed in Radiology in 1982, by Hanley and McNeil: “the area represents the probability that a randomly chosen diseased subject is (correctly) rated or ranked with greater suspicion than a randomly chosen non-diseased subject”. That is a statement about the ordering of pairs of cases. Nothing else. It says nothing about which false-positive rates a hospital can afford.
The rest of this lesson is a sequence of places where that gap decided the outcome. A sepsis model ran across 38,455 hospitalizations with an area under the ROC curve of 0.63, and alerted on 18% of them. A simulated biomarker held an AUC above 0.9 while its precision fell below 0.2. A diagnostic device was authorised on a prespecified pair of sensitivity and specificity numbers, and on no curve at all.
A curve describes possibilities; policy selects one region.
Comparison
Two curves from the same score ordering
Each curve uses a different view of the confusion matrix. Which of the two deserves the weight under class imbalance is an open dispute rather than settled practice.
On imbalanced data, the precision–recall plot is the more informative one. That was Saito and Rehmsmeier's argument in PLOS ONE in 2015. A NeurIPS paper in 2024 contested exactly that. AUPRC is not generally superior, McDermott and colleagues showed, and it can unduly favour improvements in subpopulations with more frequent positive labels — a fairness consequence sitting inside what looks like a plotting preference. Then they went looking for where the belief came from: “Prompted by these insights, we conduct a review of over 1.5 million scientific papers to understand the origin of this invalid claim, finding that it is often made without citation, misattributed to papers that do not argue this point, and aggressively over-generalized from source arguments.”
So read the two columns below as two views of one ordering, not as a ranking of the two plots.
ROC curve
Plots true-positive rate against false-positive rate.
- Conditions on reference classes
- Less visually sensitive to prevalence
- Covers all thresholds
- Can emphasize irrelevant FPR regions
Precision–recall curve
Plots precision against recall.
- Focuses on positive retrieval
- Baseline tracks prevalence
- Useful for rare positives
- Still requires operating-point selection
Visual
What ROC AUC means
One way to read it is pairwise ranking. The 1982 paper that gave the area its meaning also named the estimator: “this probability of a correct ranking is the same quantity that is estimated by the already well-studied nonparametric Wilcoxon statistic”.
That quantity was written out explicitly at NIPS in 2004. Cortes and Mohri gave it as the Wilcoxon-Mann-Whitney statistic A = (sum over m positives and n negatives of 1[x_i > y_j]) / mn. They used Hanley's variance formula as the baseline their confidence intervals were compared against. The equivalence is what gives AUC a standard error and its sample-size rules.
It also fixes the limits of the number. Every pair of one positive and one negative counts once, wherever on the curve it falls. So a false-positive rate no service could staff contributes exactly as much to the average as one it operates at every day.
1. Draw one positive
Sample a reference-positive case from the evaluated population.
2. Draw one negative
Sample a reference-negative case under the same protocol.
3. Compare scores
Check whether the positive receives the higher score.
4. Average pairs
ROC AUC summarizes that ordering probability, with tie handling.
Example
An area of 0.63, a 67% miss rate, and the queue the curve does not show
Epic's proprietary Sepsis Model was validated by somebody other than its vendor, and the numbers came apart. The external validation ran at Michigan Medicine and appeared in JAMA Internal Medicine in June 2021. Wong and colleagues covered 27,697 patients and 38,455 hospitalizations, 2,552 of them with sepsis — 7%. The model's area under the ROC curve was 0.63 (95% CI, 0.62-0.64). Epic had reported 0.76-0.83.
That single figure is one line of the story. The queue is the rest of it: “The ESM also did not identify 1709 patients with sepsis (67%) despite generating alerts for an ESM score of 6 or higher for 6971 of all 38 455 hospitalized patients (18%), thus creating a large burden of alert fatigue.”
- Operational region: the same vendor model was validated again in two county emergency departments, and that study measured the point the system actually ran at. Within a six-hour window: sensitivity 14.7%, specificity 95.3%, positive predictive value 7.6%. Ostermayer and colleagues reported it in JAMIA Open in 2024.
- Global averaging: an area of 0.63 (95% CI, 0.62-0.64) is one average taken over every false-positive rate, including regions no hospital would ever staff. It cannot tell you that 18% of hospitalizations drew an alert.
- Low prevalence: sepsis appeared in 7% of those hospitalizations, and the metrics separate further as positives get rarer. A simulated biomarker showed how far: “With a prevalence of 1%, small PPV and AUPRC values (<0.2) but high AUC values (>0.9) were found.” At 50% prevalence AUC and AUPRC both tracked PPV and NPV closely (rho > 0.95). At 1% prevalence AUPRC still correlated with PPV at rho = 0.995; AUC managed 0.724. Ozenne and colleagues published the simulation in the Journal of Clinical Epidemiology in 2015.
- Timing and calibration: in the two county emergency departments the alerts arrived at a median lead time of 0 minutes. Ranking, calibration and timeliness are separate properties of a deployed system, and an area under a curve reports only the first of the three.
- Policy verdict: partial AUC, precision at the review capacity, and recall at the chosen queue size describe what a clinician actually experiences. The two numbers that decided this model's reputation — 67% of sepsis cases missed, alerts on 18% of hospitalizations — are properties of one threshold, not of the curve.
Key idea
Average precision is not trapezoidal PR AUC
Average precision commonly summarizes a precision–recall curve as a weighted mean of precision values using increases in recall, while a generic trapezoidal area can produce a different number because interpolation assumptions differ.
The difference is not a rounding artifact. A curve dominates in ROC space if and only if it dominates in PR space. Davis and Goadrich proved that at ICML in 2006, and warned in the same abstract: “For example, in PR space it is incorrect to linearly interpolate between points.” Their worked case uses 20 positives and 2,000 negatives. Point A (TP=5, FP=5) sits at recall 0.25 and precision 0.500; point B (TP=10, FP=30) at recall 0.50 and precision 0.250. Interpolated correctly, the curve passes through precision 0.375 at recall 0.30 and 0.318 at recall 0.35 — below the straight line joining A to B. That is exactly why the trapezoid flatters the model.
scikit-learn takes a side and documents which one. Its user guide states that average_precision_score implements no interpolated variant, while the linear interpolation used by the trapezoidal sklearn.metrics.auc is overly optimistic on a PR curve. It cites Davis 2006 and Flach 2015 for the reason.
Name the implementation and averaging convention. Do not report “PR AUC” without defining how it was computed.
Metric names that sound identical may encode different interpolation rules.
Analogy
A map of every possible toll price
Traffic flow and revenue can be plotted against every toll price a city might set. The curve shows the tradeoffs that exist. It contains none of the goals, legal limits, or congestion constraints the city has to satisfy, and those are what pick the price.
A curve is a decision landscape rather than a decision. Prevalence and calibration move the ground under it, so the operating point chosen today has to be chosen again later. The toll map is redrawn when the traffic changes. The precision–recall baseline is redrawn when prevalence does — which is how the same simulated biomarker holds an AUC above 0.9 while its PPV and AUPRC fall below 0.2.
The best-looking curve does not choose the acceptable operating point.
Steps
Compare curves in the region that matters
Global AUC can be replaced or supplemented by targeted summaries. A regulator did precisely that, in public, and the paperwork is the clearest worked example available.
IDx-DR is a retinal diagnostic software device. When the FDA authorised it in January 2018, the feasible region had been fixed in advance: prespecified performance thresholds of 85.0% sensitivity and 82.5% specificity. The pivotal study enrolled 900 participants at 10 primary care sites. It returned observed sensitivity 87.4% and specificity 89.5%. Enrichment-corrected, that was 87.2% (95% CI 81.8-91.2%) and 90.7% (95% CI 88.3-92.7%), with imageability 96.1% (819/852) and positive predictive value 72.7% (173/238). Abràmoff and colleagues reported the same trial in npj Digital Medicine.
The special controls attached to the classification then say what evidence has to travel with the device: “Clinical performance testing must evaluate sensitivity, specificity, positive predictive value, and negative predictive value for each endpoint reported for the indicated disease or condition across the range of available device outcomes.” No area under any curve appears in that list. The steps below are the same discipline applied to a model nobody is required to file.
1. Define the feasible region
Translate capacity or harm limits into recall, precision, or false-positive constraints.
2. Plot uncertainty
Use bootstrap bands or repeated valid splits around the relevant curve segment.
3. Report partial summaries
Compute partial AUC, precision at k, or recall at a fixed burden.
4. Inspect crossings
Recognize that one model can dominate at one threshold range and lose elsewhere.
5. Select the policy
Choose the threshold with costs, slices, and calibration in view.
Discrimination, calibration, and utility are separate
Ranking and calibration come apart: a model can rank cases well while producing unreliable probabilities. Another model can be calibrated on average yet offer weak discrimination. Neither property alone specifies utility.
The two plots were tested against each other on imbalanced data in PLOS ONE in 2015. Saito and Rehmsmeier found that the visual reading of a ROC plot “can be deceptive with respect to conclusions about the reliability of classification performance.” The cause they identify is “an intuitive but wrong interpretation of specificity.” Precision–recall plots hold up better because they “evaluate the fraction of true positives among positive predictions.” The two plots are drawn from the same ordering and still tell different stories.
That finding is itself contested. The NeurIPS 2024 paper from McDermott and colleagues, circulated first as a preprint in January 2024, rejects the general claim that AUPRC is the better summary under imbalance. Treat the dispute as the lesson rather than the embarrassment. Which plot to trust is an argument to be made about a specific deployment, not a rule to be inherited.
Report ranking, calibration, and operating performance separately, so one strength does not conceal another weakness. And note what a regulator asked of IDx-DR when it had to commit: sensitivity, specificity, positive predictive value and negative predictive value, at one operating point, prespecified.
AUC answers an ordering question, not every evaluation question.
Key takeaways
- ROC and precision–recall curves describe tradeoffs across thresholds rather than selecting a policy. Hanley and McNeil's 1982 definition is about the ordering of pairs, not about which false-positive rates are affordable.
- ROC AUC is a ranking-discrimination summary — the Wilcoxon-Mann-Whitney statistic that Cortes and Mohri wrote as A = (sum over m positives and n negatives of 1[x_i > y_j]) / mn. It does not measure probability calibration.
- Precision–recall behavior and its baseline depend on prevalence. At 1% prevalence Ozenne and colleagues found AUC above 0.9 alongside PPV and AUPRC below 0.2, with AUPRC tracking PPV at rho = 0.995 against 0.724 for AUC.
- Average precision and trapezoidal PR area are not the same calculation. Davis and Goadrich showed linear interpolation in PR space is incorrect, and scikit-learn's average_precision_score implements no interpolated variant.
- Partial curves and capacity-specific metrics can beat global AUC. Epic's Sepsis Model scored 0.63 (95% CI, 0.62-0.64) at Michigan Medicine while missing 67% of sepsis cases and alerting on 18% of 38,455 hospitalizations.
- Discrimination, calibration, and decision utility are separate properties. That is why the FDA's IDx-DR special controls require sensitivity, specificity, PPV and NPV rather than an area under a curve.