The Impact of Ensemble Stacking with Machine Learning and Statistical Models on Improving Sales Forecasting Accuracy

Authors

  • Prima Yohana Bina Nusantara University
  • Alexander Agung Santoso Gunawan Bina Nusantara University
  • Heri Ngarianto Bina Nusantara University

DOI:

https://doi.org/10.21512/emacsjournal.v8i2.16162

Keywords:

Ensemble stacking, Sales forecasting, Machine learning, Statistical models, Random Forest, Extra Trees, XGBoost, Multiple Linear Regression, RidgeCV

Abstract

Sales forecasting in retail remains a challenge, as changing customer behavior and seasonal patterns undermine predictive accuracy. For example, during promotional periods, managers tend to respond to changes in the weather or abrupt swings in preferences, not anticipating. For this purpose, we propose an ensemble stacking framework for machine learning and statistical models to improve forecasts in dynamic demand. We used a meta-learner of RidgeCV, trained on past retail sales data, to ensemble base learners including Random Forest, Extra Trees, XGBoost, and Multiple Linear Regression. Tree-based models captured non-linear interactions, but linear regression preserved interpretability of trends. The meta-learner learned to assign adaptive weights based on recent error patterns in time windows. We assessed performance using RMSE and MAE with particular focus on high volatility periods (e.g., holiday spikes and post-promotion troughs). The stacking model achieved an RMSE of 0.7689 and an MAE of 0.3066, outperforming individual base models consistently. Stacked predictions also showed less week-to-week variance and faster recovery after sudden shifts in demand. These results show that stacking can capture heterogeneous demand dynamics better than single models and, hence, provide a more robust structure. In practice, it allows for more confident safety-stock decisions and timely replenishment adjustments. Retailers can run a number of models in parallel and continuously rebalance them with new data as it comes in. Future work may include online updates of meta-learners and external covariates such as local events or competitor pricing.

Dimensions

Author Biographies

Prima Yohana, Bina Nusantara University

Computer Science Department, BINUS Graduate Program - Master of Computer Science

Alexander Agung Santoso Gunawan, Bina Nusantara University

Computer Science Department, School of Computer Science

Heri Ngarianto, Bina Nusantara University

Computer Science Department, School of Computer Science

References

Adewumi, I. O. (2026). Predictive Analytics for Sales Forecasting in Emerging Market Retail: An Ensemble Learning and Time-Series Approach for A&Z Supermarket. Community and Social Development Journal, 27(1), 95–114. https://doi.org/10.57260/csdj.2026.286583

Al-Bazi, A., H. Al-Salami, Q., Zulfikar, N., Jerjees, Z., & A. Ahmad, M. (2025). Advanced Performance Analysis in Sport Footwear Sales Prediction Using Machine Learning. The 5th International Scientific Conference on Administrative and Financial Sciences (CIC-ISCAFS’2025), 14–21. https://doi.org/10.24086/icafs2025/paper.1582

Attipoe, E. K., Yussiff, A. S., Asante-Mensah, M. G., Tetteh, E. D., & Turkson, R. E. (2025). An ensemble learning approach for diabetes prediction using the stacking method. Computer Science and Information Technologies, 6(2), 102–111. https://doi.org/10.11591/csit.v6i2.p102-111

Bihri, H., Charaf, L. A., Azzouzi, S., & Charaf, M. E. H. (2025). A Robust Stacking-Based Ensemble Model for Predicting Cardiovascular Diseases. AI, 6(7), 160. https://doi.org/10.3390/ai6070160

Daza, A., Sánchez, C. F. P., Apaza-Perez, G., Pinto, J., & Ramos, K. Z. (2024). Stacking ensemble approach to diagnosing the disease of diabetes. Informatics in Medicine Unlocked, 44, 101427. https://doi.org/10.1016/j.imu.2023.101427

El-Boghdady, A. M., Kishk, S., Ashour, M. M., & AbdElhalim, E. (2023). Machine-learning based stacked ensemble model for accurate multi classification of CBC Anemia. Mansoura Engineering Journal, 49(3), 4. https://doi.org/10.58491/2735-4202.3144

Googerdchi, K. F., & Jafari, S. M. (2025). Sales Forecasting in Retail Using Random Forest Regression: A Case Study on Walmart. 2025 4th International Conference on Computing and Information Technology (ICCIT), 592–597. https://doi.org/10.1109/ICCIT63348.2025.10989314

Hasan, M. D. R. (2024). Addressing seasonality and trend detection in predictive sales forecasting: A machine learning perspective. Journal of Business and Management Studies, 6(2), 100–109. https://doi.org/10.32996/jbms.2024.6.2.10

Jafar, R., Awad, A., Hatem, I., Jafar, K., Awad, E., & Shahrour, I. (2023). Multiple Linear Regression and Machine Learning for Predicting the Drinking Water Quality Index in Al-Seine Lake. Smart Cities, 6(5), 2807–2827. https://doi.org/10.3390/smartcities6050126

Jodar-Abellan, A., Van Oudenhove, M., De Vente, J., Boix-Fayos, C., & Eekhout, J. (2025). Predicting bankfull channel dimensions through Stepwise Multiple Linear Regression and Random Forest in intermittent Mediterranean streams.   In EGU General Assembly Conference Abstracts (pp. EGU25-11060). https://doi.org/10.5194/egusphere-egu25-11060

Karaoğlu, A., & Söyler, H. (2025). A New Approach for Improving Biodiesel Conversion Efficiency: A Stacking Ensemble Model Based on Linear Regression Approach with GAN-Enhanced. Arabian Journal for Science and Engineering, 50(23), 19421–19441. https://doi.org/10.1007/s13369-025-10227-5

Kumar, M., Singhal, S., Shekhar, S., Sharma, B., & Srivastava, G. (2022). Optimized Stacking Ensemble Learning Model for Breast Cancer Detection and Classification Using Machine Learning. Sustainability, 14(21), 13998. https://doi.org/10.3390/su142113998

Li, X. (2025). A study on monthly sales forecasting of new energy vehicles in urban areas using the WOA-BiGRU model. PloS One, 20(4), e0320962. https://doi.org/10.1371/journal.pone.0320962

Mame, M., Huang, S., Li, C., & Zhou, J. (2025). Application of Extra-Trees Regression and Tree-Structured Parzen Estimators Optimization Algorithm to Predict Blast-Induced Mean Fragmentation Size in Open-Pit Mines. Applied Sciences, 15(15), 8363. https://doi.org/10.3390/app15158363

Manzanas, R. (2020). Assessment of Model Drifts in Seasonal Forecasting: Sensitivity to Ensemble Size and Implications for Bias Correction. Journal of Advances in Modeling Earth Systems, 12(3), e2019MS001751. https://doi.org/10.1029/2019MS001751

N, P. H., P, K. D., M, S., & R, S. M. (2025). Sales Data Visualization and Future Predictions Using Power BI and Machine Learning. 2025 IEEE International Conference on Compute, Control, Network & Photonics (ICCCNP), 1–6. https://doi.org/10.1109/ICCCNP63914.2025.11233722

Shoko, C., Sigauke, C., & Makatjane, K. (2025). An Application of Ensemble Stacking in Machine Learning to Predict Short-term Electricity Demand in South Africa. Statistics, Optimization & Information Computing, 13(6), 2412–2433. https://doi.org/10.19139/soic-2310-5070-2170

Wang, M., Liu, Y., Li, G., Yue, Y., & Man, K. L. (2024). Unlocking Your Sales Insights: Advanced XGBoost Forecasting Models for Amazon Products. International Conference on Advanced Multimedia and Ubiquitous Engineering, 181–187. https://doi.org/10.1007/978-981-95-1565-3_23

Wang, N., & Li, Z. (2022). A stacking-based short-term wind power forecasting method by CBLSTM and ensemble learning. Journal of Renewable and Sustainable Energy, 14(4). https://doi.org/10.1063/5.0097757

Windrasari, S. N., Margono, H., & Putra, Y. A. N. S. (2025). Predictive Sales Analysis in Coffee Shops Using the Random Forest Algorithm. MALCOM: Indonesian Journal of Machine Learning and Computer Science, 5(3), 1000–1011. https://doi.org/10.57152/malcom.v5i3.2023

Yao, B. (2023). Walmart Sales Prediction Based on Decision Tree, Random Forest, and K Neighbors Regressor. Highlights in Business, Economics and Management, 5, 330–335. https://doi.org/10.54097/hbem.v5i.5100

Downloads

Published

2026-08-23

How to Cite

Yohana, P., Gunawan, A. A. S., & Ngarianto, H. (2026). The Impact of Ensemble Stacking with Machine Learning and Statistical Models on Improving Sales Forecasting Accuracy. Engineering, MAthematics and Computer Science Journal (EMACS), 8(2), 133–144. https://doi.org/10.21512/emacsjournal.v8i2.16162
Abstract 19  .
PDF downloaded 10  .