ML
intermediate
Precision/Recall Trade-off & PR vs ROC
A classifier outputs a score, not a class — something compares it to a threshold. Drag that threshold and watch every metric move, then drag the positive class rare and watch the ROC curve hold steady while the PR curve collapses. Same model, same scores, two different verdicts.
algorithms.live
Scores, and the line drawn through them
Anything at or right of the red line is predicted positive. Green bars right of it are true positives; grey bars right of it are false positives.
50
50%
55
Precision
87.7%
783 / 893
Recall (TPR)
78.3%
783 / 1000
F1
82.7%
harmonic mean
FPR
11.0%
110 / 1000
The same model, judged two ways
Precision-Recall
AUC 0.925
ROC
AUC 0.925
With a roughly balanced positive class the two curves broadly agree — ROC AUC 0.925 against PR AUC 0.925. Drag the positive class rate below 10% and watch them come apart.
Which error is worse here?
Sort
Sort each application by the metric it should optimise.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
Favour recall
Drop items hereFavour precision
Drop items here6 pieces left to place
Test your knowledge
20 questions
Question 1 of 20
Score: 0
What does a binary classifier actually produce before any class label exists?
Learn these first
Interview Questions
Google
Meta
Stripe
Amazon
Stripe
PayPal
Capital One
Meta
Visa
Stripe
Uber
Booking.com
Google
Anthropic
Capital One
Airbnb
References & Further Reading
ROC and AUC, Clearly Explained!YouTube · StatQuest
video
precision_recall_curve — scikit-learnscikit-learn Docs
docs
Tuning the decision threshold for class prediction — scikit-learnscikit-learn Docs
docs
The Relationship Between Precision-Recall and ROC Curves (Davis & Goadrich, 2006)University of Wisconsin-Madison
paper
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required