Skip to content
Predict.ai

Data & drivers

Lag feature

A lag feature is a past value of a series, shifted by k steps, used as an input. Lag 7 on daily data is 'the same weekday last week.' Most time-series models are careful lag machines.

Lag 1 captures yesterday. Seasonal lags capture the calendar. You pick them from the decision clock, not from a list of integers a blog recommended.

The trap is lag 0 of the target when you are predicting now — that is just the answer. The other trap is a lag of a covariate you would not have had yet. Draw the timeline.

Too many lags on a short series overfit. A foundation model may ingest raw history instead of hand-made lags; you still need the serving path to see the same history the training path saw.

Formula

lag_k(y)_t = y_{t-k}

Read next

Related terms

Try it on your data.

Connect an outcome and its history. Predict.ai finds the drivers, races the models, and keeps the forecast live — in the workspace, over the API, and through agents.