Precision-Recall AUC Calculator
Calculate the area under the Precision-Recall curve (PR-AUC) from a list of recall/precision points.
Inputs
One point per line or separated by semicolons, each as Recall,Precision — e.g. 0,1; 0.2,0.95; ...; 1,0.3
PR-AUC
0.7800
Number of Points
6
Step by step
Sort points by recall ascending
(0, 1), (0.2, 0.95), (0.4, 0.9), (0.6, 0.8), (0.8, 0.6), (1, 0.3)
= 6 points
PR-AUC: Σ trapezoid areas between consecutive points
Σ (Precision_i + Precision_{i+1})/2 × (Recall_{i+1} − Recall_i)
= 0.7800
How it works
The Precision-Recall (PR) curve plots precision against recall across classification thresholds, and the area under it (PR-AUC, closely related to Average Precision) summarizes performance in a single number focused on the positive class. Unlike ROC-AUC, PR-AUC is highly sensitive to class imbalance in a useful way — because precision is influenced by how rare the positive class is, PR-AUC drops noticeably for models that struggle to find a rare positive class, making it a preferred metric for imbalanced problems like fraud or anomaly detection.
Formula
PR-AUC = sum((Precision_i + Precision_{i+1}) / 2 * (Recall_{i+1} - Recall_i))
- P_i
- Precision at point i
- R_i
- Recall at point i
Frequently Asked Questions
Why prefer PR-AUC over ROC-AUC for imbalanced data?
ROC-AUC can look deceptively good on imbalanced datasets because the false positive rate denominator is dominated by the large negative class, while PR-AUC's precision term is directly affected by how many false positives occur relative to true positives, better reflecting real-world performance on the rare class.
What does a PR-AUC close to the positive class rate mean?
A PR-AUC roughly equal to the fraction of positive examples in the dataset indicates the model provides little discriminative value over a random classifier — a useful baseline to compare against.
Is PR-AUC the same as Average Precision?
They're closely related and often used interchangeably; Average Precision is typically computed as a weighted sum over precision values at each recall level achieved by actual predictions, which is numerically similar to trapezoidal integration of the PR curve.