time-serieslisted
Install: claude install-skill TranBaDat2607/claude-code-kaggle-grandmaster
# Time-Series Playbook
## 1. Validation first
- Forward-chaining splits (`kgkit.cv.time_series_splits`) with `gap ≥ forecast horizon`
and validation windows the same length as the test period. The **last** fold best mirrors
the LB; weight it, but use several folds to measure stability.
- Never shuffle. Never compute features with data after the forecast origin.
- For targets defined over overlapping windows (finance), use purged K-fold with embargo.
- Simulate the exact inference situation: at forecast origin T you only know data ≤ T (and
sometimes with a reporting delay). Reproduce that delay in features.
## 2. The global GBDT recipe (wins most forecasting comps)
One LightGBM over all series (store×item etc.), rows = (series, date), features:
- **Lags** of the target at horizons ≥ forecast horizon (direct) or rolling recursion;
lags at seasonal periods (7, 14, 28, 364 for daily).
- **Rolling stats** (mean/std/min/max/median/EWM) over windows, shifted by the horizon
(`kgkit.features.lag_features(shift=h)`).
- **Calendar**: dow, dom, week, month, holidays/events (country-specific), paydays, school terms,
days to/from events; cyclical encodings.
- **Series-level static**: category, store, item attributes; target encodings by group (OOF in time).
- **Price/promotion/exogenous**: relative price vs series mean, promo flags, weather.
- **Trend proxies**: ratio of recent window mean to long window mean.
Objectives: Tweedie/Poisson for sparse counts (M5), L2 on log1p