Data leakage occurs when a model uses predictive information that will not be available when a real prediction is made. It can temporarily inflate training or validation results, then lead to disappointing performance on new cases. The practical test is temporal consistency: features should describe the prediction point or an earlier point, not information created afterward. section 2.2.7
Leakage appears at two levels. Feature-level leakage uses an unavailable column directly. Row-level leakage arises when observations are connected by time or group membership, allowing a model to exploit relationships that will not recur in validation or deployment. section 2.1.1 section 2.2.7
Prevent misleading estimates by checking both features and splits:
- Verify when every feature and target is generated; exclude a feature when it is produced after the prediction point. section 2.2.7
- Represent meaningful group membership when appropriate, but segregate groups across cross-validation folds when that membership cannot be reproduced in test data. section 2.1.1
- Treat leakage features as a tabular-data pathology alongside irrelevant, duplicated, highly collinear, or poorly populated columns. section 2.2 section 2.5
- Exercise a trained model on a few genuinely new data points early, forcing an explicit check of which inputs will exist after deployment. section 9.5.1 section 9.6
Loan decisions and future behavior
For a loan-granting model, late-payment history can look highly predictive in historical training data. Yet it is future behavior at the time the loan decision is made, so using it creates future leakage rather than a usable production feature. section 2.2.7
Property-price predictions
A model predicting whether a new Kuala Lumpur listing will sell above or below the median cannot rely on “Weeks on the market,” because that value is known only after the property has sold. Trying a brand-new listing exposes the missing input immediately. section 9.5.1
Figure 9.18 Validating the features used to train the model with a new data point
Use the figure to trace how validating a feature against a new listing reveals whether it exists at prediction time. section 9.5.1








