Skip to content

Repository files navigation

Sales Forecasting & Demand Intelligence System

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.

📊 Project Features

The project is structured around 8 key analytics tasks:

  1. Data Loading, Merging & Deep Exploration: Datetime feature engineering, data quality audits, and key business question analysis.
  2. Time Series Analysis & Decomposition: Statsmodels additive decomposition (Trend, Seasonal, Residual) and Augmented Dickey-Fuller (ADF) stationarity testing.
  3. 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.
  4. Segment-Level Forecasting: Individual forecasting for Furniture, Technology, Office Supplies, East Region, and West Region.
  5. Sales Anomaly Detection: Comparison of global Isolation Forest outliers vs. local Z-Score rolling deviations.
  6. Product Demand Segmentation: K-Means clustering of sub-categories based on volume, YoY growth, volatility, and order value with tailored stocking strategies.
  7. Interactive Dashboard: A 4-page Streamlit dashboard featuring sales overview filters, forecast horizon controls, anomaly reports, and stocking guidelines.
  8. Executive Report: A professionally compiled 2-page PDF report designed for the CFO and Head of Supply Chain.

📁 Repository Structure

├── 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

⚙️ Installation & Setup

To run the interactive dashboard or Jupyter Notebook locally, follow these steps:

1. Clone the Repository

git clone https://github.com/Chirag04-bit/SalesForecasting-Superstore.git
cd SalesForecasting-Superstore

2. Install Dependencies

Ensure you are using Python 3.11 or later:

pip install -r requirements.txt

3. Run the Streamlit Dashboard

streamlit run app.py

4. Open the Jupyter Notebook

jupyter notebook analysis.ipynb

🔬 Model Evaluation Results (Summary)

Our 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

👤 Author

  • Chirag Sharma - Demand Analytics & Forecasting System

About

End-to-end Sales Forecasting & Demand Intelligence System utilizing Prophet, SARIMA, XGBoost, Isolation Forest, K-Means clustering, and an interactive Streamlit dashboard.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages