← ClaudeAtlas

time-serieslisted

Winning playbook for Kaggle time-series and forecasting competitions — leak-free time validation, lag/rolling/calendar features, global GBDT models, recursive vs direct multi-horizon forecasting, hierarchical reconciliation, deep forecasting models, financial/market prediction with purged CV, and sensor/event sequences. Use whenever the target depends on time or the test period is in the future.
TranBaDat2607/claude-code-kaggle-grandmaster · ★ 2 · AI & Automation · score 75
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