RetailPredict is a sales forecasting application providing 4 machine learning algorithms to predict future sales based on historical data and compare their performances.
The project aims to forecast the number of items sold for a successive month based on the sales data of the previous 12 months, additionally it is also provides insights into the monthly sales differences to assist businesses in anticipating demand, optimizing resource allocation, and making informed decisions. It utilizes machine learning models, including Linear Regression, Ridge Regression, Random Forest Regression, XGBoost Regression to predict future sales accurately.
- Python (3.10.12)
- PyYAML (6.0.1)
- autopep8 (2.0.4)
- numpy (1.26.4)
- pandas (2.2.1)
- xgboost (2.0.3)
- scikit-learn (1.4.1.post1)
- matplotlib (3.8.3)
The performance of the trained models is evaluated using Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and R2 Score metrics, which provide insights into the accuracy and effectiveness of the predictions.
The project utilizes a Store Item Demand Forecasting Data, comprising approximately 913,000 entries without any NULL values. Each entry includes information such as the date of sale, store ID, item ID, and the number of items sold at a particular store on a specific date.
The machine learning models are trained using the sales data of the previous 12 months. Subsequently, the trained models are tested to predict the number of items sold for the successive month. The performance of each model is assessed based on its ability to accurately forecast future sales.
- Navigate into the Predictor directory
- Create virtual environment & activate
- Install the requirements
pip install -r requirements.txt
- With Linear Regression:
python sales_predict.py
python sales_predict.py linear
- With Ridge Regression:
python sales_predict.py ridge
- With Random Forest:
python sales_predict.py forest
- With XG Boost:
python sales_predict.py xgb
python model_compare.py