Interactive Lab · Model Evaluation
A classifier isn't one number. It scores every case, and you pick where to cut. Slide that cutoff and precision, recall, and accuracy all move at once. Sweep it across every value and you trace the ROC curve, the whole truth about the model, before you've committed to any threshold. The area under it, AUC, is one honest score that accuracy can't fake. Drag the line and watch both worlds move together.
🎬 Watch the 90-second explainer, then slide the threshold and separation below ↓
▶ The playground, drag the threshold, tune the model
Two score distributions. Red = sick patients (positive) · blue = healthy (negative). Everything right of the line is predicted positive. Drag the line.
The ROC curve: every threshold is one point (FPR→, TPR↑). The purple area is AUC. The diagonal is a coin-flip. The dot is your current threshold.
ROC/AUC is the standard interview and industry answer to 'accuracy is 95%, is the model good?' on imbalanced data: fraud (0.1% positives), medical screening, ad conversion. The accuracy illusion you just reproduced is the reason model cards report AUC/PR curves, and threshold selection (see the Threshold lab) is a separate business decision.
The code that's actually running
Set class balance to ~5% positive and push the threshold up near 1.0 so the model predicts almost everything negative. Before you look: what happens to accuracy, and to the ROC dot? Now read them. Accuracy stays sky-high (~95%) while the dot collapses toward the origin (TPR ≈ 0, it catches nobody). Why is accuracy the wrong metric here, and what is AUC telling you instead? Then drag separability from 0 to 3.4 and watch AUC climb from 0.5 (coin flip) toward 1.0 (perfect), without touching the threshold.
The takeaway