This project forecasts monthly product demand using simple time-series methods. The goal is to demonstrate practical forecasting techniques for inventory and supply chain planning.
Two models are implemented and compared:
- Moving Average
- Simple Exponential Smoothing
The best-performing model is then used to forecast future demand.
The original dataset contains daily demand data for multiple SKUs.
The data was aggregated into monthly demand for a single product: SKU-004.
- First 9 months: training data
- Last 3 months: test data
This allows evaluation of model accuracy on unseen data.
A 3-month moving average is used:
Forecast = average of last 3 months
Simple exponential smoothing with:
α = 0.3
This method gives more weight to recent observations.
Two error metrics are used:
- MAE (Mean Absolute Error)
- MAPE (Mean Absolute Percentage Error)
| Model | MAE | MAPE |
|---|---|---|
| Moving Average | 24.10 | 3.83% |
| Exponential Smoothing | 20.98 | 3.32% |
The exponential smoothing model performed better.
Using the best model, the forecasted demand is:
| Month | Forecast |
|---|---|
| Jan 2026 | 612 units |
| Feb 2026 | 612 units |
| Mar 2026 | 612 units |
demand-forecasting-python/
│
├── data/
│ └── inventory_sales_daily.xlsx
│
├── outputs/
│ ├── monthly_series_SKU-004.xlsx
│ ├── monthly_series_SKU-004.png
│ ├── model_comparison_SKU-004.xlsx
│ ├── forecast_test_comparison_SKU-004.png
│ └── future_forecast_SKU-004_*.xlsx
│
├── demand_forecasting_report.pdf
├── demand_forecasting.py
├── requirements.txt
└── README.md
- Python
- pandas
- numpy
- matplotlib
- Excel
- Install dependencies:
pip install -r requirements.txt
- Run the script:
python demand_forecasting.py
Outputs will be saved in:
outputs/
Parnia Riazat