A production-grade demand forecasting system that predicts product demand across multiple time horizons (daily, weekly, monthly) for retail inventory management. The system handles hierarchical product structures, incorporates external regressors, and produces probabilistic forecasts with prediction intervals.
This project implements an end-to-end demand forecasting pipeline for retail supply chain optimization. It addresses the challenge of predicting demand at different granularities while maintaining coherence across product hierarchies.
- Multi-horizon forecasting: Daily, weekly, and monthly predictions from a unified model architecture
- Hierarchical reconciliation: Coherent forecasts across category, subcategory, and SKU levels
- Probabilistic outputs: Quantile regression providing prediction intervals for inventory planning
- External regressors: Integration of holidays, promotions, weather, and custom business events
- Automated tuning: Bayesian optimization for hyperparameter selection across model ensemble
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Data Ingestion │────▶│ Feature Pipeline │────▶│ Model Training │
│ (Raw Sales) │ │ (Engineering) │ │ (Ensemble) │
└─────────────────┘ └──────────────────┘ └────────┬────────┘
│
┌─────────────────┐ ┌──────────────────┐ ┌────────▼────────┐
│ Inference │◀────│ Reconciliation │◀────│ Evaluation │
│ (Serving) │ │ (Hierarchical) │ │ (Metrics) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
demand-forecasting-engine/
├── src/
│ ├── data/ # Data loading and validation
│ ├── features/ # Feature engineering pipeline
│ ├── models/ # Model implementations and ensemble
│ ├── evaluation/ # Metrics and cross-validation
│ └── utils/ # Shared utilities
├── tests/ # Unit and integration tests
├── notebooks/ # Exploratory analysis and experiments
├── docs/ # Documentation and implementation plans
├── configs/ # Configuration files
└── scripts/ # Training and inference scripts
- Core: Python 3.10+, NumPy, Pandas, Scikit-learn
- Modeling: LightGBM, XGBoost, CatBoost (gradient boosting ensemble)
- Optimization: Optuna (Bayesian hyperparameter tuning)
- Hierarchical: Custom reconciliation with MinT/OLS methods
- Validation: Temporal cross-validation with expanding windows
This project is under active development. See the Implementation Plan for the detailed roadmap and current progress.
MIT License