Module 2 · Classifiers and generalisation · Lesson 5
Metrics, thresholds and calibration
The confusion matrix and the metrics that read off it, ROC and precision–recall curves, a threshold chosen from the cost of each kind of mistake rather than 0.5 by habit, and the calibration check that tells you whether a probability of 0.8 means 80%.
By the end of this lesson you can
- Fill a confusion matrix from predictions and labels, and compute accuracy, precision, recall (TPR), specificity (TNR), false-positive rate and F1 by hand
- Draw ROC and precision–recall curves from scores, explain what AUC measures, and say when the PR curve is the more informative of the two
- Derive the cost-minimising threshold from the cost of a false positive and a false negative, and check it against a threshold search on validation data
- Build a reliability diagram, compute expected calibration error and the Brier score, and repair a miscalibrated model with Platt scaling or isotonic regression
- Explain why a classifier or judge that ranks well but is miscalibrated misleads every decision built on its probabilities
