An end-to-end data science and machine learning project built on the Superstore Sales dataset. This system is designed to help retail managers, logistics coordinators, and financial executives optimize inventory replenishment, detect sales anomalies, and forecast future demand.
The project is structured around 8 key analytics tasks:
- Data Loading, Merging & Deep Exploration: Datetime feature engineering, data quality audits, and key business question analysis.
- Time Series Analysis & Decomposition: Statsmodels additive decomposition (Trend, Seasonal, Residual) and Augmented Dickey-Fuller (ADF) stationarity testing.
- Multi-Model Sales Forecasting: Build, train, and compare three models:
- SARIMA (p, d, q) x (P, D, Q)12 statistical model.
- Facebook Prophet daily/monthly seasonal forecaster.
- XGBoost Regressor with recursive multi-step lag and rolling features.
- Segment-Level Forecasting: Individual forecasting for Furniture, Technology, Office Supplies, East Region, and West Region.
- Sales Anomaly Detection: Comparison of global Isolation Forest outliers vs. local Z-Score rolling deviations.
- Product Demand Segmentation: K-Means clustering of sub-categories based on volume, YoY growth, volatility, and order value with tailored stocking strategies.
- Interactive Dashboard: A 4-page Streamlit dashboard featuring sales overview filters, forecast horizon controls, anomaly reports, and stocking guidelines.
- Executive Report: A professionally compiled 2-page PDF report designed for the CFO and Head of Supply Chain.
├── analysis.ipynb # Executed Jupyter Notebook containing all 8 tasks
├── app.py # Standing Streamlit web application code
├── requirements.txt # Python dependency specifications
├── summary.pdf # Compiled 2-page business report (PDF)
├── train.csv # Superstore sales source dataset
├── vgsales.csv # Video game sales secondary dataset
├── product_segmentation.csv # Cached clustering segments for Streamlit
├── weekly_sales_anomalies.csv # Cached anomaly flags for Streamlit
├── .python-version # Pins Streamlit Cloud runtime to Python 3.11
├── README.md # Project overview and run instructions
└── charts/ # Directory containing saved analysis plots
To run the interactive dashboard or Jupyter Notebook locally, follow these steps:
git clone https://github.com/Chirag04-bit/SalesForecasting-Superstore.git
cd SalesForecasting-SuperstoreEnsure you are using Python 3.11 or later:
pip install -r requirements.txtstreamlit run app.pyjupyter notebook analysis.ipynbOur monthly sales models were evaluated on the final 3 months of historical data using backtesting:
| Model | MAE | RMSE | MAPE | Recommendation |
|---|---|---|---|---|
| SARIMA | $19,299.92 | $20,205.76 | 20.36% | Backup statistical model |
| Prophet | $18,059.76 | $18,559.11 | 19.60% | Recommended for Production |
| XGBoost | $24,188.55 | $28,468.86 | 25.37% | Experimental baseline |
- Chirag Sharma - Demand Analytics & Forecasting System