This repository contains a complete end-to-end workflow for forecasting supermarket beverage sales, including beer, wine, and liquor. The project evaluates multiple classical time series models alongside deep learning architectures to determine the most effective approach for retail demand forecasting.
The entire analysis is implemented in a single notebook (project.ipynb) and includes data preprocessing, model training, evaluation, and comparative analysis.
This project builds and compares several forecasting models, including:
Classical Statistical Models:
- ARIMA
- SARIMAX
- Double Exponential Smoothing (DES)
- Triple Exponential Smoothing (TES)
Deep Learning Models:
- Vanilla LSTM
- Bidirectional LSTM
- Stacked LSTM
Each model is evaluated against real retail beverage sales data to assess predictive performance and practical applicability.
The dataset used in this project is sourced from:
Warehouse and Retail Sales – Data.gov
https://catalog.data.gov/dataset/warehouse-and-retail-sales/resource/b1ecfb86-7b0a-4619-a263-ffbc37f4e3e0
The dataset provides monthly sales values for various product categories.
This project focuses specifically on beverage categories and converts the dataset into a clean, time-indexed format suitable for forecasting.
- Data cleaning and preprocessing
- Exploratory time series analysis
- Building and training statistical forecasting models
- Designing and training deep learning LSTM-based models
- Performance evaluation using MSE, RMSE, and R²
- Visual comparison of forecasts versus actual sales
- Results interpretation and insights
All required packages can be installed as follows:
Required Libraries:
- numpy
- pandas
- matplotlib
- scikit-learn
- statsmodels
- tensorflow
- keras
- notebook
Recommended environment:
- Google Colab
- VS Code with Python virtual environment
- Any machine with GPU support for faster LSTM training
-
Download the dataset from the link above.
-
Place the CSV file in the project directory.
-
Open the notebook:
-
Run all cells in order to:
- Load and clean the dataset
- Train ARIMA, SARIMAX, DES, TES models
- Train LSTM, Bidirectional LSTM, and Stacked LSTM models
- Evaluate forecasting performance
- Selection of relevant beverage categories
- Combining month and year fields into a single DateTime column
- Creating a proper time-series index
- Splitting data into training and testing sets
Each model is trained using the preprocessed dataset.
Hyperparameters are chosen based on time series diagnostics and experimentation.
Models are evaluated using:
- Mean Squared Error (MSE)
- Root Mean Squared Error (RMSE)
- R² Score
Plots and metrics allow straightforward comparison of:
- Classical vs. Deep Learning methods
- Speed vs. accuracy
- Short-term vs. long-term forecasting ability
Best Model:
- SARIMAX, showing the most stable and accurate performance across all categories
General Observations:
- DES and TES performed poorly due to data characteristics
- Stacked LSTM and SARIMAX produced strong forecasts
- Deep learning models required significantly longer training time
- Limited dataset size restricts long-term prediction accuracy
- Use larger, more diverse supermarket datasets
- Add external variables such as promotions, holidays, or inflation
- Build hybrid statistical + neural network models
- Apply automated hyperparameter tuning (Optuna, grid search, Bayesian optimization)
- Improve generalization with more data preprocessing and augmentation
- Dataset does not contain large historical volume
- Sales patterns vary widely across categories
- Some models are sensitive to strong trends and limited observations
- Real-world deployment would require additional feature engineering