Evaluation

Business metrics against model metrics, offline against online, cross-validation and its temporal variant, slices — and the rule that the test set is touched once.

Business Metrics vs Model Metrics
▶ lab

A model metric describes the model; a business metric describes what happened when the model's output was acted on. The map between them is the operating point and the action, and a better model metric can produce a worse business outcome.

Q · The new fraud model has a clearly better AUC, and after rollout the fraud losses did not fall. What sits between the model metric and the business one, and which of them should decide the next release?
Offline vs Online Evaluation
▶ lab

Offline evaluation scores a model on a historical dataset produced by the previous policy. Online evaluation measures what happens when the model acts on live traffic. Strong offline numbers are a reason to run the online test, not a substitute for it.

Q · Offline, the new recommendation model beats the incumbent on every metric. What could make it worse in production, and what would you have to run to find out?
Cross-Validation
▶ lab

k-fold cross-validation trades k trainings for a lower-variance estimate and a spread. It is the right tool for small data and model selection, the wrong tool for temporal or grouped data unless the folds respect the structure, and it is not an evaluation of the model you will ship.

Q · With a few thousand labelled examples, a single holdout gives a metric that moves noticeably every time the split seed changes. When does k-fold fix that, when does it make things worse, and what does it cost?
Time-Series Validation
▶ lab

When the model will predict the future, validate on the future: forward-chaining folds, a gap between training end and validation start equal to the label delay, and never a shuffle. A random split on temporal data is a leakage simulator with a nicer name.

Q · A churn model validated with a random split looks excellent and degrades within a month of deployment. What did the split let the model see, and what does an honest temporal validation look like?
Evaluation Slices

An aggregate metric is a weighted average over subgroups, and the weights are the dataset's, not the business's. A model can improve on average and regress on the segment that matters, and only a sliced evaluation can see it.

Q · The new model is better overall and the complaints are up. Which subgroup got worse, why did the aggregate hide it, and what should the evaluation have reported instead?
Metric Uncertainty

A validation metric is a sample statistic with an interval around it. Two models compared on the same holdout need a paired comparison; a small test set cannot distinguish small improvements; and every comparison made against one holdout erodes it a little.

Q · The candidate beats the incumbent by a small margin on the holdout. Is that a real improvement, how would you know, and what has the holdout already been used for?
Never Tune on the Test Set
▶ lab

The test set is touched once. Every look costs information; hyperparameter search, feature selection, early stopping and model selection all happen on validation. A team that picks the best of forty runs on the test set has shipped noise with a certificate.

Q · Forty training runs, the best one chosen by its test-set score, and production well below that score. What did the test set stop being, and where should each of those forty decisions have been made?