StatFASPrecision–Recall Curve makerGuideTutorial

Guide · Updated 2026-11-07 · Free tool included

Precision-Recall Curve: Meaning, Uses and How to Interpret Average Precision

A precision–recall curve plots precision (the share of positive predictions that are correct, also called positive predictive value) against recall (the share of true positives found, also called sensitivity) for every threshold of a classifier. This guide explains what the precision–recall curve shows, when and why to use the precision–recall curve, the key points of interpretation, and how to create the precision–recall curve in SPSS, R and Python or in seconds on statfas.com.

What is a precision–recall curve?

A precision–recall curve plots precision (the share of positive predictions that are correct, also called positive predictive value) against recall (the share of true positives found, also called sensitivity) for every threshold of a classifier. The precision–recall curve focuses entirely on the positive class.

The summary number is average precision (AP), often called AUPRC. Because the precision–recall curve ignores true negatives, the precision–recall curve stays honest when negatives vastly outnumber positives.

When and why should you use a precision–recall curve?

Use a precision–recall curve in these situations:

On imbalanced data a model can reach an AUC above .90 while most positive calls are wrong. The precision–recall curve exposes that problem, which is why Saito and Rehmsmeier (2015) recommend the precision–recall curve for imbalanced classification.

How to interpret a precision–recall curve: key points

How to make a precision–recall curve in SPSS, R and Python

The snippets below show the core commands; the full precision–recall curve tutorial has complete, copy-and-run code. Examples assume a data frame df with the columns named in the code.

Precision–Recall Curve in SPSS

Standard SPSS menus do not offer a dedicated precision–recall curve. Run Analyze > Classification > ROC Curve with Coordinate points of the ROC Curve ticked, copy the Coordinates table (sensitivity and 1 − specificity) into a new dataset, then compute precision from the prevalence of the positive class with the syntax below and draw recall against precision with Graphs > Chart Builder (scatter/line).

SPSS syntax

* sens = Sensitivity column, fpr = 1 - Specificity column from the ROC coordinates table.
* 0.10 is the prevalence of the positive class in your data; replace it with your own value.
COMPUTE prec = (sens*0.10) / (sens*0.10 + fpr*0.90).
EXECUTE.
GRAPH /SCATTERPLOT(BIVAR)=sens WITH prec.

Precision–Recall Curve in R

R code

library(PRROC)
pr <- pr.curve(scores.class0 = df$score[df$outcome == 1],
               scores.class1 = df$score[df$outcome == 0], curve = TRUE)
pr$auc.integral

Precision–Recall Curve in Python

Python code

from sklearn.metrics import precision_recall_curve, average_precision_score
p, r, thr = precision_recall_curve(df["outcome"], df["score"])
ap = average_precision_score(df["outcome"], df["score"])

The easy way: free precision–recall curve maker on statfas.com

The Precision–Recall Curve maker on statfas.com uploads an Excel, CSV or SPSS file, draws the precision–recall curve with the no-skill baseline, and returns average precision with a bootstrap 95% CI, the lift over prevalence, a bootstrap p value and the best-F1 threshold. No coding is needed: upload the file, confirm the columns and read the results.

Try the precision–recall curve maker

How to report a precision–recall curve in APA 7

Example wording (illustrative values; replace with your own results):

Because the outcome was imbalanced (prevalence = .10, N = 400), precision–recall analysis was used. Average precision was .52, 95% bootstrap CI [.41, .63], which was 5.2 times the no-skill baseline and significantly exceeded the baseline, p < .001.

Place the figure number and title above the precision–recall curve and a note below, as the APA 7 style requires. The statfas.com precision–recall curve maker writes the caption and results paragraph automatically.

Frequently asked questions

When should I use a precision-recall curve instead of a ROC curve?
Use a precision–recall curve when the positive class is rare or when false positives are costly. Report both curves if space allows.
What is a good average precision?
Judge average precision against the baseline, which equals the prevalence. An AP of .30 is excellent when prevalence is .02 but poor when prevalence is .40.
What is the difference between AUPRC and average precision?
Both summarise the precision–recall curve. Average precision uses a step-wise sum, while some packages use trapezoidal or Davis–Goadrich interpolation, so values can differ slightly.
How do I find the best threshold on a precision-recall curve?
Many analysts take the threshold with the highest F1 score. Others fix a minimum precision, such as .90, and choose the highest recall that meets the target.

References

Chicco, D., & Jurman, G. (2020). The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genomics, 21, Article 6.

Saito, T., & Rehmsmeier, M. (2015). The precision-recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets. PLOS ONE, 10(3), Article e0118432.

Make a precision–recall curve now. Open the free precision–recall curve makerStep-by-step Precision–Recall Curve tutorial

More StatFAS guides

ROC Curve guide · Confusion Matrix guide · Calibration Plot guide · Feature Importance Plot guide