openskills.info
Course Preview

Feature Engineering for Time Series

Feature engineering for time series turns timestamps, earlier observations, and data known at prediction time into model inputs. It helps a forecasting or time-dependent model represent recurring calendar patterns, recent behavior, and changes without using information from the future.

itArtificial intelligence and machine learning

Don't Panic — Feature Engineering for Time Series

Feature engineering for time series is the art of turning an ordered history into rows a model can use, with one rule that makes it harder than the tabular kind: every feature in the row for time t must be computable using only information available at t. A feature that reads from the future is not a feature. It is a leak.

The first idea to hold is the cutoff time — the latest moment the prediction is allowed to know about. Pick it. That is the boundary between information and answer. A lag is a value from an earlier period of the same series: the demand one hour ago, the count from yesterday, the reading from a week ago. Trailing windows summarize recent level and variation: mean, standard deviation, min, max — all ending at or before the cutoff. They describe history without peeking.

Timestamps carry structure too. Calendar features — hour, weekday, month, holiday status — describe recurring conditions known in advance. Resampling aligns irregular events to a uniform grid so rows become comparable. An exogenous feature (a weather forecast, a published schedule) is valid only when the value used would have been available at the cutoff. A later corrected observation is not the same thing.

Evaluation follows the same discipline. A random split breaks the temporal story by training on future observations and testing on past ones, which makes the score look better than a live forecast deserves. Time-aware validation keeps the training set before the test set and expands the training window across folds. Build every learned transformation inside the training portion of each split so the offline pipeline matches the online one.

Leakage hides in future lags, centered rolling windows, global aggregates computed over all rows, randomly shuffled train and test splits, and external values used at their event time rather than their publication time. Missing timestamps are another hazard: a lag measured in row count may no longer mean a fixed duration.

The cheatsheet covers the feature families, window semantics, and the leakage scan checklist. The practice reference and exercise turn the rules into a pandas and scikit-learn pipeline. The Reference tab carries the path into scikit-learn's time-series examples and Forecasting: Principles and Practice. The Timeline tab traces how the field moved from manual lag engineering through automated extraction to frameworks that bake temporal awareness into the feature contract.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources