What is the single most common data leak in time series ML? #30
Verified answer
by
martex-dev
martex-dev
asked this question in
Q&A
|
What is the single most common data leak in time series ML? Notes and answer below. |
Admin verified this answer by
martex-dev
Aug 27, 2026
Replies: 1 comment
|
Fitting the preprocessing on the whole dataset before splitting. A StandardScaler fitted before the split has already seen the test period's mean and variance. The structural fix is to put every transform inside a pipeline object so it is refit on each training fold, which makes the leak impossible rather than merely unlikely. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fitting the preprocessing on the whole dataset before splitting. A StandardScaler fitted before the split has already seen the test period's mean and variance. The structural fix is to put every transform inside a pipeline object so it is refit on each training fold, which makes the leak impossible rather than merely unlikely.