A lag is an earlier value of a time-series feature used relative to the prediction time. Shifting values backward creates features that let a model use past observations when making a prediction. section 11.1.2
Retail demand
To forecast an item’s sales for September 8, a simple baseline uses its actual sales from September 1. Going back a full week rather than one day accounts for weekly seasonality and possible delays in data availability. A linear-model baseline can instead use multiple lags alongside rolling aggregates. section 8.6.1
More lags can help a model capture more complex patterns and seasonality, but they also make it easier to overfit. Compare a short history, such as the previous three days, with a longer one, such as the previous 30 days, using a model-wise learning curve to choose an appropriate number. section 9.4.1
Lags are one way to reuse past data. Window aggregates, such as means, maxima, or minima, offer another way to summarize a history rather than supplying each earlier value separately. section 11.1.2




