Skip to content
Predict.ai

Data & drivers

Feature engineering

Feature engineering turns raw timestamps and series into the lags, rolling stats, and calendar flags a model can use. In time series, the unforgivable sin is building those features with the future mixed in.

A good feature pipeline is boring and scheduled. The same code must run at 6am inference and at training. Notebooks that 'just compute the month total' will leak.

Start with lags, a seasonal lag, a short rolling mean, and a calendar. Add covariates you can actually know. Stop when the backtest stops moving.

A two-day lead

Leading indicator lagclicksorderslag 2
Clicks (top) peak two days before orders (bottom). Same-day correlation would call them twins. The lag is the actual product.

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.