In a time-series forecasting pipeline, which set of actions best prevents leakage when creating lag features and training an XGBoost model on aggregated user events?

Answer

Split chronologically first, then compute all lag/rolling features using only past data within each split

Explanation

Chronological splitting and feature construction restricted to prior observations ensures the model never sees future information through lags or rolling windows. Centered windows or pre-splitting feature computation can leak future outcomes.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list