Skip to main content

> 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.

time series forecastingretail cpgApache-2.0low-cloud
Back to All Recipes

Business Outcome

Forecast 14-day daily unit demand for 50,000 store-SKU combinations to optimize inventory replenishment and minimize stockouts.

Acceptance Criteria:

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.

Baseline Evaluation:

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.

Hardware: Developer laptop or workstation with 16GB RAM

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.

Hardware: Cloud CPU worker instance (16 vCPU, 64GB RAM, no GPU required)

Compute & Placement Topologies

Training Placement

Scheduled weekly batch distributed training job on CPU cluster (e.g. 16 cores, 64GB RAM)

Inference Placement

Scheduled daily batch job generating 14-day rolling purchase recommendations

3-Plan Placement Alternatives

Plan A: Simplest Viable

Single multi-core CPU server running parallel Python joblib processes for store batches.

Plan B: Hardware-Fitted

Distributed CPU worker cluster (e.g. Ray on 8 nodes) running batch distributed training and inference.

Plan C: Production-Ready

Cloud data warehouse integration (Snowflake/BigQuery) + Ray CPU distributed training + automated hierarchical reconciliation (bottom-up + top-down) + ERP webhook sync.

Recommended Libraries & Tools

★ PRIMARY TOOLLightGBMMicrosoft
View
statsmodelsstatsmodels Developers / NumFOCUS
View
DartsUnit8
View
NeuralForecastNixtla
View

Governance, Safeguards & Risks

Governance Safeguards:
  • 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.