Typical leaky variables
| Model | Leaky variable | Why it leaks |
|---|---|---|
| Credit origination | Days past due, collections flag | They only exist after the loan is granted and goes bad |
| Credit origination | Charge-off amount, account closing date | They describe the outcome itself |
| Churn | Cancellation request date, retention offer accepted | They are recorded during the exit |
| Fraud | Chargeback flag | It is the confirmation of the fraud |
Warning signs
- An AUC above 0.95, or a Gini above 0.90, on an application model.
- One variable explains almost all the predictive power.
- A large drop in performance between the test set and production.
- Variables whose names describe what happens after the decision: days_past_due, closed_date, charge_off_amount.
Worked example (illustrative figures)
| Gini in test | Gini in production | |
|---|---|---|
| With a leaky variable (collections flag) | 0.92 | 0.41 |
| Without it | 0.48 | 0.46 |
The leaky model looked far better in testing and was worse in production. The clean model kept almost all its power once deployed.
How to prevent it
- Build every row as a snapshot at the decision date: only information known at that moment.
- Split out of time: train on older periods and test on the most recent.
- Review every variable whose importance is unusually high.
- Enrich with external data as it was at the decision date, not as it is today.
How Thorcast.AI helps
- MJÖ scans for leakage candidates, such as columns whose names suggest information recorded after the decision, and asks you to review or disable them before training.
- It flags metrics that are too good to be true, such as an AUC above 0.95.
- The Date Vintages split trains on older periods and tests on the most recent ones, and Model Monitoring shows when production performance falls below the modeling values.
Frequently asked questions
What is the difference between target leakage and overfitting?
Overfitting means the model memorizes noise in the training data. Target leakage means it uses information it will not have at decision time. Both inflate test results, but leakage can survive a correct train–test split.
Can target leakage happen with external data?
Yes, if the external data is taken as it is today instead of as it was at the moment of each decision.
How do I check a model for leakage?
Look at the most important variables and ask, for each one, whether you would know its value at the moment of the decision. Then compare test and recent out-of-time results.