Skip to content
AI360Xpert
Core ML

Visual explainer

Precision-Recall Curve

Why accuracy and ROC curves fail on imbalanced data, and how to measure true positive performance instead.

When predicting rare events (like fraud or disease), a model that simply always says "no" achieves 99% accuracy while doing absolutely nothing useful. We need metrics that focus exclusively on the positive class.

The Mechanism: Sweeping the Threshold

Moving the decision threshold trades precision for recall.
Moving the decision threshold trades precision for recall.

Classification models output continuous probability scores, not hard binary answers. Turning those probabilities into a "yes" or "no" requires setting a decision threshold.

Moving this threshold forces a fundamental trade-off. If you raise the threshold to be strict, you rarely cry wolf (high Precision) but you miss many real targets (low Recall). If you lower the threshold to catch every target (high Recall), you trigger a flood of false alarms (low Precision).

The Precision-Recall Space

The PR Curve records the tradeoff at every possible threshold.
The PR Curve records the tradeoff at every possible threshold.

By graphing Precision against Recall for every possible threshold, we get a curve that describes the model's fundamental ranking capability.

Unlike an ROC curve, a Precision-Recall curve is highly jagged. Because Precision evaluates the exact pool of positive predictions, dropping the threshold to include a new False Positive causes Precision to immediately drop (creating a vertical cliff), while adding a True Positive increases Recall and pulls Precision back up (creating a diagonal rise).

Why PR Curves Beat ROC on Imbalanced Data

ROC is deceptive when negatives overwhelm the dataset; PR reveals the truth.
ROC is deceptive when negatives overwhelm the dataset; PR reveals the truth.

When your dataset is dominated by the negative class, the ROC curve becomes dangerously misleading. Because the ROC curve relies on the False Positive Rate (FPR), millions of True Negatives dilute the denominator, keeping FPR tiny even when the model generates thousands of false alarms.

The Precision-Recall curve ignores True Negatives entirely. It forces the model to prove that when it claims to have found a rare target, it is actually right. If the model is guessing, the PR curve will plummet, exposing poor performance that the ROC curve hid.