Sales Forecasting in Retail Using Random Forest Regression: A Case Study on Walmart
Accurate sales forecasting is crucial for retail giants like Walmart to optimize inventory management, plan operations, and enhance customer satisfaction. This study aims to develop a robust machine learning model for predicting weekly sales at Walmart stores, focusing on identifying the most important predictive features and utilizing the Random Forest Regressor. Using a comprehensive dataset from Kaggle, we conducted thorough data preprocessing, including addressing missing values and encoding categorical variables. Recursive Feature Elimination (RFE) was employed to determine the most significant features. The Random Forest Regressor, chosen for its ability to handle complex relationships, was parameterized with 100 estimators and evaluated using metrics such as Mean Squared Error (MSE), Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and R-squared (R2) score. The model achieved an R2 score of 0.9741, significantly outperforming a baseline model. Diagnostic plots confirmed the model's robustness, with errors following a normal distribution and residuals showing no discernible patterns. This research demonstrates the efficacy of machine learning, particularly the Random Forest Regressor, in enhancing sales forecasting accuracy in the retail sector, providing insights into feature importance and supporting strategic decision-making for inventory and operational planning. The paper concludes that the Random Forest Regressor significantly enhances Walmart's sales forecasting accuracy with a high R-squared score of 0.9741, outperforming baseline models and demonstrating robust predictive performance.
Authors
- Kaveh Faraji Googerdchi (ORCID: https://orcid.org/0000-0002-1908-5222)
- Seyed Mohammadbagher Jafari (ORCID: https://orcid.org/0000-0003-2042-2756)
Institutions
- University of Tehran (IR)
- Isfahan University of Art (IR)
Publication Details
- Published
- 2025-04-13
- DOI
- https://doi.org/10.1109/iccit63348.2025.10989314
- Primary Topic
- Customer churn and segmentation
- Type
- article
- Field-Weighted Citation Impact
- 0.00