A binary classifier outputs a continuous score s ∈ [0,1] for each item; a decision threshold τ turns scores into predicted labels: predict positive if s ≥ τ. Here two synthetic populations of scores (true negatives and true positives) are drawn from overlapping normal distributions whose separation you control — this is exactly the situation for any real classifier (spam filter, fraud model, medical test).
Given predicted vs actual labels at threshold τ:
Precision = TP / (TP + FP) "of items I called positive, how many really are"
Recall = TP / (TP + FN) "of real positives, how many did I catch"
F1 = 2·P·R / (P + R) harmonic mean of precision & recall
FPR = FP / (FP + TN) fraction of negatives wrongly flagged
ROC curve = TPR vs FPR swept over every possible τ
AUC = area under that curve (0.5 = random guessing, 1.0 = perfect)
- Threshold slider — moves the decision plane along the score axis in the 3D view; every bar left/right of it flips between predicted-negative and predicted-positive, changing all four confusion-matrix counts live.
- Class separation — controls how far apart the two score distributions sit; low separation means an inherently weak classifier no threshold can fully fix, which the ROC curve and AUC make visible.
- Prevalence — the true fraction of positives in the data; raising it while holding a fixed threshold shows why accuracy alone is misleading on imbalanced data, while precision/recall react more honestly.
- Snap to optimal τ — jumps to the threshold that maximizes F1 for the current data, illustrating that "optimal" depends on which metric you actually care about.
Real-world relevance: this threshold/ROC trade-off is the core evaluation tool behind every deployed classifier — email spam filters, medical screening tests, fraud detectors — where moving τ trades false alarms against missed detections.