A classifier said ‘positive’ a thousand times — how good is it? Not just ‘accuracy’: on rare things (disease, fraud) a model can be 99% accurate by always saying ‘no’. The confusion matrix splits every prediction into true/false positives and negatives, from which PRECISION (of my yeses, how many right?) and RECALL (of the real yeses, how many caught?) fall out — and they trade off. Slide the threshold and watch precision and recall swap.
A confusion matrix tabulates predictions vs truth: true positives (TP), false positives (FP), false negatives (FN), true negatives (TN). From them: PRECISION = TP/(TP+FP) (how many predicted-positives are right), RECALL = TP/(TP+FN) (how many actual-positives are caught), ACCURACY = (TP+TN)/all, and F1 = harmonic mean of precision and recall. Raising the decision threshold trades recall for precision (and vice-versa). Accuracy alone MISLEADS on imbalanced classes — hence these separate metrics. A fail-loud self-check throws unless the metric formulas match known counts (TP40,FP10,FN5,TN45 → prec .80, rec .89, acc .85). ◆ real ML evaluation, node-verified.
The threshold slider models how counts shift; the exact TP/FP/FN/TN depend on the model and data. The metric FORMULAS and the precision–recall tradeoff are exact — the honest reminder that one number (accuracy) hides the real behaviour.