> ML_RECIPE // HIERARCHICAL-RETAIL-DEMAND-FORECASTING_v1.0
Hierarchical Retail Store-SKU Demand Forecasting
Forecast 14-day daily unit demand for 50,000 store-SKU combinations to optimize inventory replenishment and minimize stockouts.
Business Outcome
Forecast 14-day daily unit demand for 50,000 store-SKU combinations to optimize inventory replenishment and minimize stockouts.
Forecast must consistently beat 4-week seasonal moving average across >= 85% of SKU volume.
Heuristic Baseline
Seasonal Moving Average: 4-week historical sales mean for the same day of the week.
Seasonal moving average achieved WAPE 0.31 with severe over-forecasting during promotional weekends.
Phase 1: Prototype Path
Engineer lag features, calendar promotions, and rolling window statistics on top 500 SKUs. Fit LightGBM regression model and evaluate WAPE and SMAPE.
Phase 2: Production Path
Partition forecasting jobs by store category in Apache Spark/Ray. Train weekly LightGBM models with hierarchical reconciliation. Publish purchase orders to ERP.
Compute & Placement Topologies
Scheduled weekly batch distributed training job on CPU cluster (e.g. 16 cores, 64GB RAM)
Scheduled daily batch job generating 14-day rolling purchase recommendations
3-Plan Placement Alternatives
Single multi-core CPU server running parallel Python joblib processes for store batches.
Distributed CPU worker cluster (e.g. Ray on 8 nodes) running batch distributed training and inference.
Cloud data warehouse integration (Snowflake/BigQuery) + Ray CPU distributed training + automated hierarchical reconciliation (bottom-up + top-down) + ERP webhook sync.
Recommended Libraries & Tools
Governance, Safeguards & Risks
- Enforce manual procurement override caps preventing automated purchase order surges greater than 200% of historical monthly volume.
- Isolate pandemic/lockdown anomalous historical periods from standard seasonal training windows.
