How does target leakage differ from train-test contamination?

Last updated 14 November 2026

  • Target leakage: features contain information unavailable at prediction time (e.g. took_antibiotics for pneumonia). It fools even clean splits and fails in production. Fix with point-in-time feature construction.

  • Train-test contamination: evaluation data seeps into training or model selection (preprocessing fit before splitting, duplicates or shared users across splits, tuning on test). The model may be fine, but its performance estimate is optimistic.

  • Fix contamination by splitting first, fitting preprocessing inside folds (Pipeline), and using group or time splits. Also dedupe and touch the test set once.

  • https://www.geeksforgeeks.org/machine-learning/data-leakage/
  • https://www.dasca.org/world-of-data-science/article/data-leakage-in-machine-learning-why-your-best-model-fails-in-production
  • https://www.geeksforgeeks.org/machine-learning/machine-learning-interview-questions/
All Supervised Learning interview questions