Cheat sheet: metrics
Which number to look at, and what it hides.
Confusion matrix
- TP: fraud caught. FN: fraud missed. FP: false alarm. TN: normal payment passed.
Learn more: Measuring models honestly · Classification: picking a category
Accuracy, precision, recall, F1
- Accuracy hides rare-class failure.
- Precision: of what we flagged, how much was real. Recall: of what was real, how much we caught.
accuracy = (TP + TN) / all
precision = TP / (TP + FP)
recall = TP / (TP + FN)
F1 = 2 x precision x recall / (precision + recall)
Learn more: Measuring models honestly
The threshold
- A threshold turns a probability into a decision.
- Moving it trades precision against recall.
Learn more: Classification: picking a category
Honest evaluation
- Split before training; cross-validate; keep the test set out of tuning.
- For time series use walk-forward splits.
Learn more: Measuring models honestly · Time-series forecasting
Drift
- A population stability index (PSI) below 0.1 is stable, 0.1 to 0.25 needs a look, above 0.25 is a large shift.
Learn more: Monitoring models and AI apps in production
Language models and applications
- Perplexity compares models only when they use the same tokeniser and text.
- An eval set with thresholds blocks a bad release.
- Compare group rates for fairness.
Learn more: Evaluating language models · Evaluating AI applications · Responsible AI: fairness, privacy, transparency and oversight