A business prediction can look remarkably accurate for the wrong reason. Instead of anticipating what will happen, the model may be finding traces of an answer that would not exist when the real decision is made.
That problem is called data leakage. In this context, it does not mean a privacy breach. It means the model received information, directly or indirectly, that was unavailable at the point of prediction. The usual result is an evaluation score that flatters the model and disappoints when it meets new cases.
The most useful question is not, “Did we remove the target column?” It is: What could this model genuinely have known at the moment it was asked to make this prediction?
Start by defining the prediction moment
Write one operational sentence before reviewing features or model scores. For example:
> At 9:00 a.m. on an invoice’s due date, before payment status is known, predict whether the invoice will be more than 30 days late.
That sentence establishes the boundary. It tells reviewers which information is fair game and which information arrived too late.
Consider a late-payment model. A final write-off code is clearly off limits. So is a dispute-resolution status recorded after the due date. Other fields are less obvious. “Days since last collection contact” may be legitimate, but only if that contact happened before 9:00 a.m. on the due date.
Historical tables can hide this distinction. A field may be complete now because it was updated days later, corrected after review, or recalculated when the invoice closed. Its database timestamp is not always the same as its real business availability.
Make a feature-availability ledger
For every candidate input, create a short record that answers:
- What does this feature measure?
- Which system or process creates it?
- When does it become reliably available?
- Can it change after the prediction moment?
- Can the same definition be produced when a live prediction is requested?
- Should the feature be allowed, excluded, or investigated further?
This does not need to be elaborate. A spreadsheet is often enough. The discipline matters more than the format.
The ledger is especially useful for fields with vague names such as “status,” “stage,” “final amount,” or “last activity.” Those names may represent a valid pre-decision signal, or they may encode the aftermath of the outcome being predicted.
Aggregates deserve the same scrutiny. A customer payment-history measure might seem harmless, but it can leak if it was recalculated using the invoice now being scored. Every aggregate should have an “as-of” date: what would this value have been on that historical prediction date?
Test the evaluation, not only the inputs
Leakage can enter through the way data is split for testing.
For a forecast, training on later observations and testing on earlier ones creates an unrealistic advantage. A demand model that predicts next week’s demand should be evaluated on periods later than its training data. Otherwise, it may absorb later conditions that were unknown at the time of the earlier forecast.
Repeated entities need similar care. A churn dataset might contain several monthly records for each customer. If those records are scattered randomly between training and test data, the model may benefit from recognizing a customer’s established pattern rather than learning to assess a new customer.
A customer-level holdout, a forward-in-time holdout, or both may provide a more honest test. The appropriate choice depends on the intended claim. Is the model meant to score future records for known customers, entirely new customers, or both?
A random split is not automatically wrong. It can be reasonable when observations are independent and the operating environment is stable. The split should mirror the decision the business expects the model to support.
Keep learned steps inside the training process
Leakage is not limited to business fields. It can occur during preparation.
Scaling, filling missing values, selecting features, and reducing dimensions all learn something from data. If those steps are fit on the full dataset before a test split, the test set has influenced the model-building process.
The safer sequence is straightforward: split first, then fit each learned preparation step using training data only. Apply the resulting transformation to the held-out data without relearning it there.
This is one reason a clean-looking workflow can still produce an overly optimistic score. Excluding the target is necessary, but it is not enough.
Investigate performance that seems too good
An unusually strong result is not proof of leakage. Some problems are genuinely predictable. Still, a score that seems implausible should trigger an audit rather than immediate celebration.
Try a feature-removal challenge. Remove the most suspiciously powerful fields, then compare performance. If the result collapses, trace those fields back through their definitions, source timing, and production availability.
Also compare results under a deployment-like holdout. If performance falls sharply when moving from a random split to later data or entity-separated data, investigate why. The drop may indicate leakage, but it can also reflect changing business conditions, a harder future population, or limited data.
Before release, confirm that each approved feature is available in the live workflow, arrives in time, and is calculated the same way as it was historically. A legitimate historical field is not useful if it is delayed, absent, or defined differently when a business user asks for a prediction.
The standard for trust is practical: the team should be able to explain what the model knew, when it knew it, and why its evaluation resembles the decision it will support. Until then, an impressive score is only a reason to ask better questions.
Morrow Creek Data Services handles paid research, cleanup, verification, and structured delivery projects.
Start a data project