Data Leakage¶
Core Idea¶
Data leakage is the pattern by which information that should not have been available at decision time nevertheless enters a process during calibration, training, or evaluation — making it look more skilful than it is. The leak may come from the target, the future, the test set, or the evaluator. The result is inflated performance now, disappointment later, and a misallocation of trust in between.
How would you explain it like I'm…
Answers On The Back
Peeking At The Answers
The Broken Firewall
Broad Use¶
- Machine learning: target leakage, train-test contamination, and temporal leakage from future information.
- Clinical research: outcome or treatment information leaking into supposedly blinded measurement.
- Project estimation: estimating completed projects with full hindsight the original estimators never had.
- Auditing: an evaluator with prior exposure to the company's narrative, or advance notice of the sample.
- Examinations: item exposure, practice-set overlap, or graders aware of authorship inflating the score.
- Finance: backtesting with look-ahead bias — restated earnings, survivorship-filtered universes — that disappoints live.
Clarity¶
It forces three questions: what information was supposed to be unavailable, through what channel might it have entered (direct, upstream, temporal, social), and what would performance be without it. It names the asymmetry: the clean counterfactual cannot be recovered once seen.
Manages Complexity¶
It compresses target leakage, look-ahead bias, item exposure, and audit contamination into one frame — a firewall that should have held and did not — with one fix family: enforce the firewall by construction, not by auditing afterward.
Abstract Reasoning¶
It teaches that a performance number is only as trustworthy as the firewall behind it, so any reported skill should be audited for what the process could have illicitly seen, and a genuinely naive evaluation should be engineered up front.
Knowledge Transfer¶
- ML → research: blinding, pre-registration, and held-out analysis are the protocol analogue of train-test separation.
- ML → finance: look-ahead bias is temporal target leakage; point-in-time data reconstruction is the firewall.
- ML → exam design: rotating item pools, embargoed items, and blind grading are firewall mechanisms whose failure is item exposure.
Example¶
A fraud classifier uses a "claim was investigated" feature, but investigation only happens after fraud is suspected, so the feature encodes the answer. Cross-validated accuracy looks high; at genuine forecast time the feature does not yet exist and skill collapses. The fix is a strictly time-based split that admits each feature only with its real-world availability.
Relationships to Other Abstractions¶
Current abstraction Data Leakage Prime
Parents (2) — more general patterns this builds on
-
Data Leakage is a kind of, conditional Past-State Contamination Prime
Time leakage is the model-evaluation species in which future or held-out information enters fitting, feature construction, calibration, or validation.
-
Data Leakage presupposes Validation Prime
Data leakage presupposes a validation boundary separating information legitimately available at decision time from information reserved for calibration or evaluation.
Children (1) — more specific cases that build on this
-
Imputation Leakage Domain-specific is a kind of Data Leakage
Imputation leakage is data leakage specialized to preprocessing statistics fitted with information from outside the training fold or decision-time boundary.
Hierarchy paths (3) — routes to 3 parentless roots
- Data Leakage → Past-State Contamination → Temporal Dynamics → Time
- Data Leakage → Validation → Feedback
- Data Leakage → Validation → Verification → Evaluation → Comparison → Self Checking
Not to Be Confused With¶
- Data Leakage is not Escape and Leakage because data leakage names forbidden information entering a naive process, whereas escape names a constrained quantity exiting; the shared word hides opposite directions and inverts the remedy.
- Data Leakage is not Data Integrity because integrity concerns whether data is correct, whereas leakage concerns whether correct-but-forbidden information crossed a boundary — the leaked feature is typically perfectly accurate.
- Data Leakage is not the Future Wheel because the future wheel maps a decision's downstream effects forward, whereas leakage is the inverse error — future information leaking backward into a process meant to be naive of it.