A full-stack supply chain decision support system built in Python. Combines machine learning demand forecasting, inventory optimization, and an AI copilot into a live interactive dashboard.
Most demand forecasting projects stop at the forecast. This one goes further — turning forecasts into actionable inventory decisions and wrapping everything in an AI assistant you can talk to in plain English.
The full pipeline:
- Generates or ingests sales data (synthetic + real Rossmann store data)
- Cleans and engineers features for machine learning
- Trains Prophet and LightGBM models per SKU/store and auto-selects the best
- Calculates Safety Stock, Reorder Points, and EOQ for every product
- Displays everything in a live Plotly Dash dashboard
- Answers natural language supply chain questions via Claude AI copilot
| Model | Synthetic Data MAPE | Real Data MAPE |
|---|---|---|
| Prophet | 12.8% | 15.9% |
| LightGBM | 14.9% | 6.9% |
Key finding: LightGBM improved dramatically on real Rossmann pharmacy data because pharmacy sales are driven by operational features (competition distance, promotions, store type) rather than seasonal calendar patterns. Prophet degraded slightly because necessity goods lack strong seasonal signals.
demand-forecaster/
│
├── modules/ # Core pipeline modules
│ ├── generate_data.py # M1 - Synthetic data generation
│ ├── clean_data.py # M2 - Data cleaning & feature engineering
│ ├── forecast.py # M3 - Prophet + LightGBM forecasting engine
│ ├── inventory.py # M4 - Safety stock, ROP, EOQ optimization
│ └── backtest.py # M5 - 80/20 backtesting evaluation
│
├── dashboards/ # Visual interfaces
│ ├── dashboard.py # Main S&OP dashboard + AI copilot
│ └── results.py # Synthetic vs real data comparison
│
├── real_data_pipeline.py # Rossmann real data integration
├── copilot.py # Standalone AI copilot (terminal)
├── images/ # Dashboard screenshots
│
├── data/ # Generated synthetic data outputs
├── real_data/ # Rossmann store sales data
│
└── README.md
| Tool | Purpose |
|---|---|
| Python | Core language |
| Pandas | Data manipulation |
| Prophet | Time series forecasting (Meta) |
| LightGBM | ML-based forecasting (Microsoft) |
| Scikit-learn | Model evaluation metrics |
| Plotly Dash | Interactive dashboard |
| Anthropic Claude API | AI supply chain copilot |
- Safety Stock: Z-score method at 95% service level (Z=1.65)
- Reorder Point: (Avg demand × lead time) + safety stock
- EOQ: Harris-Wilson formula with $50 order cost assumption
- Backtesting: 80/20 train/test split with MAPE and RMSE evaluation
- Model Selection: Auto-selects best model per SKU based on test MAPE
- Sampling: Proportional stratified sampling by store type based on sales contribution
1. Install dependencies:
pip3 install pandas numpy plotly dash prophet lightgbm scikit-learn anthropic pyarrow
brew install libomp2. Add your Anthropic API key:
Create a config.py file in the root directory:
ANTHROPIC_API_KEY = "your-key-here"
⚠️ Never commit this file. It is already listed in.gitignore.
3. Generate synthetic data and run pipeline:
python3 modules/generate_data.py
python3 modules/clean_data.py
python3 modules/forecast.py
python3 modules/inventory.py4. Run main dashboard:
python3 dashboards/dashboard.py5. Run results comparison:
python3 dashboards/results.py6. Run real data pipeline (requires Rossmann data from Kaggle):
python3 real_data_pipeline.py- Synthetic data: Generated programmatically with realistic seasonality, trends, and promotions across 30 SKUs in Electronics, Apparel, and Food categories
- Real data: Rossmann Store Sales — 1M+ daily sales records from 1,115 German pharmacy stores. 30 stores selected via proportional stratified sampling by store type based on sales revenue contribution.
Hunter Johnson — Supply Chain Management, University of Tennessee Knoxville
Built as a portfolio project demonstrating applied ML in supply chain contexts.



