data-portfolio

← Portfolio · Notebook


Hierarchical Retail Demand Forecasting — M5

Business question

Produce coherent SKU × store × week forecasts — a category forecast must equal the sum of its SKUs — to plan shelf replenishment and department buying off the same numbers.

Data & EDA

Modeling

Level Approach
Aggregate (national weekly) SARIMA(1,1,1)(0,1,1)₅₂
Base (item × store) GradientBoostingRegressor with lag/calendar/rolling features
Reconciliation MinT-OLS projection across the full hierarchy: TOTAL / STATE (3) / STATE×DEPT (15) / BOTTOM (130)

Validation

Level pre-recon mean RMSSE post-recon mean RMSSE Δ
TOTAL (1 series) 3.11 3.13 +0.02 (slightly worsens — pulled toward bottom-up)
STATE (3 series) 2.30 2.25 −0.05 (improves)
STATE×DEPT (15 series) 1.59 1.57 −0.02 (improves)
BOTTOM (130 series) 1.305 1.299 −0.006 (negligible)

What the numbers say: coherence holds by construction (bottom sums match TOTAL by linear algebra). Measurable error reduction only shows up at the mid-levels where MinT typically earns its keep (STATE, STATE×DEPT). TOTAL slightly worsens because reconciliation pulls the SARIMA aggregate toward the bottom-up sum; BOTTOM barely moves.

Deployment sketch

Business outcome

Next iterations: WLS / MinT-shrink reconciliation using empirical forecast-error covariances; add M5 calendar price/promo features; evaluate across rolling-origin windows for CI on each level’s RMSSE delta.