Skip to content

Data Leakage

A situation where information from test data or from the future leaks into training data, which would not be available in practice. The model is 'cheating': the evaluation is high, but in reality, it performs worse.

Examples

  • Normalized data before splitting — the model saw the test statistics;
  • The target variable accidentally included in the features;
  • Test examples ended up in the training set.

Why It's Dangerous

The most insidious error: everything looks great on tests, but in production, the model fails.

How to Avoid

Separate data before any processing, carefully monitor features, and keep the test set completely isolated.

See Also

← All Terms