Skip to content
Bots
← All editions

AI Open Source Radar / #132

sktime

Paulo Cesar Braga2 min read

An edition written for the Bots website. Project on GitHub ↗

AI Open Source Radar #132 — sktime

On the first day we established a weekly baseline. Now imagine two tests for the same seven-day forecast. One uses month-end cutoffs. The other shuffles observations before splitting training and test data. The latter can report better numbers simply because future records were available when estimating the past.

The problem it solves

Leakage can also be subtle. A rolling average can include the very day being forecast, an imputer can fit the full dataset, and a promotion table can contain edits logged after the cutoff. The unit of evaluation is a decision with a date, a horizon, and an explicitly available set of information.

How it works

sktime provides a forecasting interface with an explicit horizon and time-based splitters such as ExpandingWindowSplitter and SlidingWindowSplitter. An expanding window keeps all history before each cutoff. A sliding window fixes the training window length. The choice should reflect how the team actually refreshes its models.

Cutoff date
↓
training window
↓
seven-day horizon
↓
forecast
↓
error by origin and horizon

How to evaluate it

Reproduce the retail protocol with three origins and horizons one through seven. Check that no test target participates in fitting. Keep transforms inside the evaluated workflow so they are fitted per window. Prepare covariates from time-stamped snapshots of what was available. Store predictions by store, product, cutoff, and horizon.

What to look for

Compare expanding and sliding windows if there has been a regime change. Record failures and series dropped, and verify that both methods forecast the same pairs. A small change in average error can hide gains on ordinary days and systematic losses during promotions.

Evidence to collect

I would save each run's cutoff, earliest and latest training dates, target date, the availability date of each covariate, and the raw data identifier. Check for violations automatically. If the records cannot reconstruct which prices the system knew on that Monday, the comparison is exploratory and needs stronger evidence before it guides a decision.

Editorial assessment

I would adopt versioned evaluation cutoffs before comparing architectures. A splitter enforces temporal order, and the team must still verify feature provenance. The next edition uses MLForecast to introduce such features while tracking what was known at the origin.