All lessons in Machine Learning Engineering: Reliable Predictive Models
Metrics, Base Rates, and Costly Errors
Calculate confusion metrics and compare rank, probability, and decision quality.
30 minutes · Members lesson · preview
What you will learn
- Compute precision, recall, false positive rate, accuracy and F1 from a confusion matrix and explain why accuracy misleads when late parcels are rare.
- Distinguish rank quality (ROC AUC), probability quality (log loss, Brier score) and decision quality (expected cost at a threshold), and state what each one ignores.
- Derive a cost-based decision threshold from false positive and false negative costs and list the assumptions behind it.
At the dispatch desk the carrier's model attaches a score to every parcel before the van leaves. In this illustrative population, 12 percent of parcels arrive late, so late is the rare, positive class. A model that never flags anything is 88 percent accurate while detecting no late parcels, which is why a single headline number is never enough. This lesson separates three different questions you can ask of a score: does the model rank late parcels above on-time ones, are its probabilities honest, and does acting on it cost less than doing nothing? Different metrics answer different questions, and the mismatch between them is where most evaluation mistakes hide.