A comprehensive web application for retail sales forecasting and inventory optimization using machine learning models.
This application provides retail businesses with powerful sales forecasting capabilities using time series analysis and machine learning.
It helps optimize inventory management, identify sales trends, and make data-driven decisions through an intuitive Flask-based web interface.
- Key performance indicators and metrics
- Store distribution analytics
- Recent sales performance tracking
- Quick access to all features
- Store type distribution visualization
- Size analysis and statistics
- Performance metrics by store type
- Comparative analytics
- Historical sales trend visualization
- Store type comparison over time
- Monthly seasonal patterns
- Interactive time series charts
- 12-week sales predictions using Prophet and ARIMA models
- Confidence interval visualization
- Model performance comparison
- Interactive forecast charts
- Optimal inventory level calculations
- Safety stock and reorder point recommendations
- Seasonal adjustment factors
- Store-type specific strategies
- Flask โ Web framework
- Pandas โ Data manipulation
- NumPy โ Numerical computing
- Matplotlib โ Data visualization
- Prophet โ Time series forecasting
- ARIMA โ Statistical forecasting model
- Scikit-learn โ Model evaluation metrics
- Bootstrap 5 โ Responsive UI framework
- Chart.js โ Interactive charts
- Font Awesome โ Icons
- Python 3.8 or higher
pip(Python package manager)
Ensure you have the following files in the project root:
stores.csv โ Store information (provided)
(Optional) Pre-trained model files from Jupyter notebook
git clone https://github.com/pragyan2004/retail-sales-forecasting.git
cd retail-sales-forecastingEnsure you have the following files in the project root:
stores.csv โ Store information (provided)
python app.py
Open your browser and go to:
http://localhost:5000
Home โ Dashboard overview with key metrics
Stores โ Store distribution and analysis
Sales Trends โ Historical sales patterns
Forecast โ Future sales predictions
Inventory โ Stock optimization recommendations
Data Loading & Preprocessing
Load store information from CSV
Generate synthetic sales data (if needed)
Handle missing values and validation
Time Series Analysis
Weekly aggregation of sales
Seasonal decomposition
Trend identification
Stationarity testing
Model Training
Prophet and ARIMA models
Evaluate with MAE, RMSE, MAPE
Forecasting & Visualization
12-week predictions
Confidence intervals
Interactive charts
Handles seasonality and holidays
Robust to missing data
Automatic changepoint detection
Statistical time series analysis
Handles trend and seasonality
Configurable parameters (p, d, q)
MAE โ Mean Absolute Error
RMSE โ Root Mean Square Error
MAPE โ Mean Absolute Percentage Error
Safety stock and reorder point recommendations
Seasonal adjustments
Store-type strategies
Weekly forecasts
Confidence intervals
Trend and seasonality insights
Type-based analytics
Size correlation analysis
Performance benchmarking
Growth opportunities