liveBook · Manning

Data leakage

As explained in Deep Learning with Python, Third Edition

The unintended transfer of information from evaluation data into model choices, causing biased estimates of generalization.

Data leakage occurs when evaluation information influences model choices, making validation or test performance look better than performance on genuinely new data. section 5.2.1

Repeated validation tuning

Try a configuration, evaluate it on the validation set, and change the model based on the score. Repeating this process leaks increasing information about the validation data and can overfit the configuration to it. section 5.2.1

Use separate evaluation roles:

  • Tune model configuration with training and validation data, recognizing that repeated validation feedback becomes a form of learning. section 5.2.1
  • Reserve the test set as a completely different, never-before-seen dataset. section 5.2.1
  • Use hold-out validation, K-fold validation, or iterated K-fold validation when data is limited. section 5.2.1

How Deep Learning with Python, Third Edition covers it

How deep it goes
Explains leakage through repeated hyperparameter tuning and stops short of broader leakage mechanisms.
Examples
Uses repeated validation experiments, hold-out splitting, K-fold validation, and iterated K-fold validation.
What it assumes
Assumes familiarity with model training and introduces the training, validation, and test split roles.
What you can do after
Evaluate generalization with a test set kept untouched during model development.
How it connects
Ties data leakage to hyperparameters, overfitting, validation sets, test sets, and cross-validation.

Also explained in

Compare how 9 books explain data leakage →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.