Evaluation & Metrics

precision-recall curve

/ pruh-SIZH-un ree-KAWL kurv /

Like the ROC curve, the precision-recall curve traces what happens as you slide a classifier's decision threshold from strict to lenient. But it plots the two quantities you most often care about when the thing you're hunting is rare: precision (when it says yes, how often is it right) on the vertical axis, against recall (of all the real positives, how many it caught) on the horizontal.

Read it as a story of compromise. Set a strict threshold and you'll be very precise but catch little (high precision, low recall — far left). Loosen up and you catch more but let in more false alarms (recall climbs, precision usually sags — far right). A strong model keeps precision high even as recall grows, so its curve stays up near the top. A useless model's curve sits flat at the level of the base rate — the simple fraction of examples that are positive.

Why prefer it over ROC? Because it does not include true negatives, it isn't fooled by a sea of easy negatives. On a 1-in-1000 fraud problem, ROC can look glorious while precision is dismal; the PR curve shows that dismal precision plainly. That makes the PR curve, and its summary the PR-AUC, the more honest choice whenever the positive class is rare and the cost of false alarms is real. The one wrinkle: the PR curve's height depends on the base rate, so you can't compare PR-AUC across datasets with different positive fractions.

In a dataset where only 2% of cases are positive, a random model's PR curve sits flat at precision 0.02. A useful model lifts the curve well above that line. The same model's ROC curve might look great at 0.9 AUC — the PR view exposes how thin the real precision is.

On rare-event data, the PR curve exposes weak precision that ROC hides.

A no-skill baseline on the PR curve is a horizontal line at the positive base rate, not the 0.5 diagonal of ROC. If your PR curve barely beats that flat line, your model has learned almost nothing useful — even if its accuracy looks high.

Also called
精确率-召回率曲线精確率-召回率曲線PR curvePR曲线P-R曲线