Data leakage

Also: target leakage, label leakage, train-test contamination

Leakage happens when features encode the answer, when preprocessing is fit on the full dataset before splitting, or when the test set is used to make modeling decisions. The model looks great in evaluation and then fails in production.

Example

Standardizing features with the mean and variance of all 10,000 rows before the split lets test-set statistics leak into training; fitting the scaler on the training fold only fixes it.

See it in the lesson: Cross-Validation →

Related terms

More in Evaluation & Validation