← 🎯 Data Science

🎯 Threshold Lab

Recall (TPR):
False Positive Rate:
Precision:
F1 score:
AUC-ROC:
AUC-PR (avg. precision):
FPS:
True positive False negative False positive True negative
Drag — rotate · Scroll — zoom

🎯 ROC Curves vs Precision-Recall Curves: Choosing the Right Threshold

Two overlapping score distributions — true negatives behind, true positives in front — get sliced live by a moving decision threshold, while a ROC curve and a precision-recall curve trace out on side boards as the threshold sweeps from strict to lenient.

🔬 What It Demonstrates

Every classification threshold trades recall against false alarms. The ROC curve's shape depends only on how separated the two classes are; the precision-recall curve additionally depends heavily on how rare the positive class is — which is exactly why the two curves can disagree.

🎮 How to Use

Drag the threshold to reclassify every bar instantly and watch both curve markers move. Lower class separability to simulate a weaker model, or drop the positive class share to simulate a rare-event problem, and see how the ROC curve barely reacts while the PR curve sags.

💡 Did You Know?

A dashed diagonal marks a random classifier's ROC curve (AUC = 0.5); on the PR board, the dashed horizontal line marks a random classifier's precision — which equals the positive class's prevalence, not 0.5.