Home/Machine Learning/Data Leakage
Machine Learning

Data Leakage

When information from outside the training set sneaks into it, producing a model that looks brilliant in testing and fails in the real world — the most common way ML projects fool their own builders.

Reviewed July 16, 2026Stable
Reading level: Curious
Pick your depth ↓

When not to use it

  • (Not applicable — leakage is a failure to avoid, not a technique to use. The "when" is: always guard against it.)

Reach for something else instead

  • Strict pipeline discipline — fit all preprocessing inside the training fold only.
  • Forward-chaining validation for time series, so you never train on the future.
  • Feature auditing — check every feature for availability at prediction time.

Sources & further reading

  • Kaufman et al. (2012), Leakage in Data Mining — the definitive formulation and taxonomy.
  • Kapoor & Narayanan (2023), Leakage and the Reproducibility Crisis in ML-based Science — how pervasive leakage undermines published results.
  • Google, Rules of Machine Learning — practitioner guidance on avoiding training/serving skew.

Primary sources, listed so you can check the claims on this page rather than take them on trust.

Where people go wrong

  • Preprocessing (scaling, imputing) before the train/test split, so test statistics leak in.
  • Including a feature that's a proxy for or caused by the target.
  • Random-splitting time-series data, training the model on information from the future.

At a glance

FieldMachine Learning
What it isoutside info contaminating training
Symptomresults too good to be true
Fixsplit first, audit every feature
DifficultyIntermediate
Flashcards for this concept · study, save or share them →
Question
Answer
1 / 4