Leakage happens when the model sees, during training, information that was not available at decision time: a feature built with future data, normalisation over the whole sample, a universe filtered with today’s survivors.
Classic k-fold cross-validation shuffles dates. Yet in finance, labels overlap: if the label is the return over the next 10 days, a training observation just before the test set shares days with it. The validation score becomes too optimistic.
Purged validation (López de Prado, 2018) removes from the training set the observations whose label window overlaps the test set (purging), then adds an embargo after the test. Example: 2,500 days, 10-day label → purge 10 days before each test block; 1% embargo = 25 days after.
The minimum: split in time order, train on the past, test on what follows, and leave a gap between them at least as long as the label (10 days here). Warning signs: 70% accuracy on daily direction, huge importance of a single feature, or a sharp drop as soon as you go live.
Examples
ML-X (fictional market) : Gradient boosting on ML-X (fictional market), label = sign of the 20-day return. Shuffled k-fold: 64% accuracy. Purged validation (20-day purge, 1% embargo): 51%. The 13-point gap came from overlapping labels: the model recognised neighbouring days it had already seen, not a real signal.
November 2021: Zillow Offers shuts down : Zillow bought and resold homes relying on price-forecasting models. When the housing market changed pace in 2021, its estimates proved too high; in November 2021, Zillow announced the wind-down of Zillow Offers, large write-downs and the loss of about a quarter of its workforce. Lesson: a model validated on the past can fail when the regime changes and when your counterparties know what you don’t (adverse selection).
Key terms
Data leakage
Future or unavailable information that enters the model’s training
Label overlap
Labels computed over time windows that overlap
Purging
Removing from the training set observations whose label overlaps the test period
Embargo
Period removed right after the test to stop information spilling over
Feature
Model input variable: for example past return or volume
Label
What the model must predict: for example the sign of the 10-day return
Train and test
Data used to train the model, and separate data used to evaluate it
K-fold
Validation that splits data into k blocks: each serves as the test in turn