The curve
Precision plotted against recall, as the threshold sweeps from high to low.
Neither has anywhere in it, and that single fact is why this curve behaves under imbalance where ROC does not.
The area beneath is usually computed as average precision, which is a sum rather than an interpolation.
- : precision and recall at the -th threshold.
The sum form is used because linearly interpolating a PR curve is optimistic: the curve between two points is not a straight line.
The baseline is not 0.5
This is the part that is most often got wrong.
A random classifier scores the class prevalence, not one half.
With 1% positives, a random model scores 0.01, so a PR-AUC of 0.4 is a strong result, and it would look like failure to anyone reading it as an ROC-AUC.
Always quote the prevalence next to the score. Without it the number cannot be interpreted at all.
Why it is the honest one when positives are rare
ROC divides false positives by the number of negatives, which is huge, so a flood of false alarms barely moves the curve.
PR divides false positives by the number of flags raised, which is small, so the same flood halves the precision.
- Suppose 100 positives and 100,000 negatives.
- A model catches 90 positives with 900 false alarms.
- is 0.009, so the ROC curve says this is nearly perfect.
- Precision is 0.09, so nine out of ten flags are wrong.
- Both are true, and only the second describes what a user experiences.
When to use which
Use ROC-AUC when the classes are near balanced, or when you genuinely care about performance on the negative class.
Use PR-AUC when positives are rare and the cost is in the false alarms you make chasing them, which is most of fraud, retrieval, moderation and screening.