A forecasting model uses lag features and rolling windows. During evaluation you discover data leakage caused by using future information in normalization. What is the correct prevention principle?

Answer

Fit any preprocessing (scaling/encoding/feature selection) using only training data and apply the learned transforms to validation/test

Explanation

Leakage is prevented by fitting preprocessing transforms solely on training data, then applying them consistently to later splits.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list