Leakage turns a 'near-perfect' model into a production flop
Tabular ML / data science practiceA team building a churn classifier reports a stunning held-out ROC-AUC of 0.99 and ships it. In production the model is barely better than guessing. The offline and online numbers disagree wildly — a textbook symptom of evaluation that measured the wrong thing.
An audit retraced the pipeline. Two leaks were found: a StandardScaler and target-encoded features had been fit on the entire dataset before splitting (so test statistics bled into training), and an 'account_closed_date' feature was effectively a proxy for the churn label that would not be known at prediction time. The fix was to move all preprocessing inside a per-fold pipeline and remove future-dependent features, then re-evaluate with stratified cross-validation and a final untouched test set.
After closing the leaks, the honest cross-validated ROC-AUC dropped to about 0.78 — far less flashy but now matching production performance within a couple of points. The lesson is the canonical one: a score that looks too good usually reflects a broken protocol, and a leakage-proof evaluation that agrees with production is worth more than a higher number that does not.
Source: An Introduction to Statistical Learning — James, G., Witten, D., Hastie, T. and Tibshirani, R.