Skip to catalogue

162

data leakage

The features contain the answer, or the future. The offline score is fiction.

What is data leakage?

Leakage is information in training that will not be available at prediction time: the label copied into a column, a feature computed with the full dataset including the row’s future, preprocessing fit on the test set. The model cheats because you handed it the answer.

Why does data leakage matter when vibe coding?

Models add “highly predictive” columns without asking when the value exists. A fraud label’s timestamp is after the decision. Name availability at decision time.

How do you do data leakage?

For each feature, write the time it becomes known. Fit scalers and encodings on train only. Drop anything that is a function of the label.

How do you ask a model for data leakage?

Check (features) for leakage. Every feature must be known at decision time. Fit preprocessing on train only. Do not include the label or a post-outcome field. If a score looks too good, assume leakage first.

What goes wrong with data leakage?

Removing the obvious label column and leaving the one the label was copied into. Grep for the source.

adjacent