Labs → Classification Metrics Lab
Classification Metrics Lab
When is precision low? Why does accuracy lie on rare classes? What does overfitting look like on data the model never saw — and what actually fixes each failure? Drag three knobs and find out: every metric, both curves, the bias–variance target and a live diagnosis with its remedy.
Baseline — darts tight around a centered ×. Break it yourself.
Healthy. Dots near their ★ corners, darts tight around a centered ×. Threshold is a business choice: which costs more, FP or FN?
actually positive · actually negative · red slash = misclassified
How to use the AUC curves — three moves
2 · Pick which AUC to read by class balance: balanced → AUC-ROC; rare positives → PR-AUC. If they disagree, believe PR-AUC.
3 · Set the threshold from the curve's shape: decide which mistake costs more (FP vs FN), find that trade-off point, use its threshold. The dot moves — the AUC never does: only a better model lifts the curve.
of everything the model FLAGGED, how much was real? (reads ACROSS the predicted+ row)
of everything actually POSITIVE, how much did we catch? (reads DOWN the actually+ column)
one number combining both — high only when BOTH are decent
share of ALL cases correct — flattering when one class dominates
how much better on memorized data than new — the overfitting detector
Reference — cause · consequence · remedy
| You observe | Why | Consequence | Remedy |
|---|---|---|---|
| Precision low, recall fine | Loose threshold / FP flood | False alarms erode trust | Raise threshold; rebalance |
| Recall low, precision fine | Strict threshold / rare positives | Real cases slip through | Lower threshold; oversample, class weights |
| Both low, train ≈ test | Underfit — high bias | Bad everywhere; threshold useless | More features/capacity, boosting |
| Train great, test poor | Overfit — high variance | Accuracy drops on real data | Regularization, bagging, more data, early stop |
| Both high (bias + variance) | Wrong model AND too little data | Unreliable and wrong — worst case | More data first, then grow capacity |
| Accuracy high, P or R low | Imbalance — negatives dominate | Metric lies; model useless at its job | Judge by F1/PR-AUC; rebalance |