An IoT-Driven Hybrid Stacking Ensemble with Deep Meta-Learning for Vending Machine Sales Forecasting

Yulisman Yulisman, Zupri Henra Hartomi, Rian Ordila, Uci Rahmalisa, Arie Linarta, Yuda Irawan

Abstract


Accurate sales prediction is essential for optimizing inventory management and supporting dynamic pricing strategies in the retail industry, particularly for vending machines (VMs) integrated with IoT technologies. The availability of real-time transactional and environmental data from IoT sensors provides opportunities to improve forecasting accuracy by capturing complex temporal patterns and external influences on consumer behavior. However, traditional time series models and single machine learning approaches often struggle to model nonlinear relationships and long-term dependencies in such data. This study proposes a hybrid stacking ensemble model that integrates machine learning and deep learning techniques to enhance the prediction of daily sales volume per Stock Keeping Unit (SKU) in IoT-enabled vending machines. The proposed framework employs Random Forest Regressor (RF), Support Vector Regression (SVR), and XGBoost Regressor (XGB) as Level-0 base learners. Their predictions, along with corresponding residuals, are utilized as meta-features for a Long Short-Term Memory (LSTM)-based meta-learner, enabling effective modeling of both nonlinear and temporal characteristics. The model incorporates diverse features derived from IoT data, including lagged sales, rolling statistics, temporal attributes (day of week and weekend indicators), and environmental variables such as temperature and humidity collected from IoT sensors. Hyperparameter optimization of the LSTM meta-model is performed using Optuna to improve model stability and generalization. The proposed approach is evaluated using 10-Fold Time Series Cross-Validation to preserve temporal data structure. Experimental results show that the proposed model achieves an R² of 0.9967 and an RMSE of 0.0899, outperforming the best individual base model, XGBoost (R² = 0.9946, RMSE = 0.1121). Although the improvement is marginal, it consistently demonstrates the advantage of combining machine learning and deep learning through a stacking ensemble strategy. These findings indicate that integrating meta-features, residual learning, and IoT-based feature engineering can improve predictive performance and support adaptive decision-making in real-time vending machine operations.


Keywords


Vending Machine; Sales Prediction; IoT; Stacking Ensamble; Machine Learning; Deep Learning;

Full Text:

PDF

References


K. Yu and L. Fang, “Adaptive hybrid models for intelligent sales forecasting,” Eng. Appl. Artif. Intell., vol. 97, p. 104087, 2021.

R. Jain and S. Patel, “Machine learning-based demand prediction for retail vending,” Comput. Ind. Eng., vol. 149, p. 106748, 2020.

A. Muhaimin, Edriyansyah, Wahyat, Y. Irawan, and R. Wahyuni, “Optimized IoT-Based Multimodal Fusion for Early Forest Fire Detection and Prediction,” ECTI Transactions on Computer and Information Technology (ECTI-CIT), vol. 19, no. 4 SE-Research Article, pp. 569–582, Sep. 2025, doi: 10.37936/ecti-cit.2025194.262839.

A. Febriani, R. Wahyuni, Y. Irawan, and R. Melyanti, “Improved Hybrid Machine and Deep Learning Model for Optimization of Smart Egg Incubator,” Journal of Applied Data Sciences, vol. 5, no. 3, pp. 1052–1068, 2024.

S. Mohammed and Z. Ali, “Big data analytics and IoT in vending machine operations,” J. Big Data, vol. 6, no. 1, p. 45, 2019.

Y. Wang and K. Zhao, “Fusion of IoT data and machine learning for predictive analytics in retail,” IEEE Trans. Industr. Inform., vol. 16, no. 9, pp. 5672–5680, 2020.

L. Xu and J. Zhang, “Optuna-based hyperparameter tuning for deep neural networks,” Appl. Soft Comput., vol. 99, p. 106898, 2021.

F. Ali and M. Hassan, “The role of IoT in predictive analytics for smart retail,” IEEE Internet Comput., vol. 24, no. 3, pp. 15–23, 2020.

S. Das and L. Dey, “Forecasting retail demand using hybrid LSTM and ML models,” Procedia Comput. Sci., vol. 189, pp. 123–132, 2021.

A. Gonzalez and R. Torres, “A review of stacking ensemble applications in forecasting,” Artif. Intell. Rev., vol. 53, pp. 4335–4356, 2020.

J. Kim and H. Lee, “Neural networks and ensemble models for sales forecasting,” Expert Syst. Appl., vol. 120, pp. 1–15, 2019.

R. Almeida and P. Costa, “Meta-learning approaches in ensemble for time series forecasting,” Inf. Sci. (N. Y)., vol. 578, pp. 345–362, 2021.

H. Nguyen and T. Tran, “Improving vending machine services with real-time IoT data and ML models,” Journal of Retailing and Consumer Services, vol. 55, p. 102135, 2020.

Y. Zhou and L. Wu, “Integration of IoT and ML for demand forecasting in automated retail,” Future Internet, vol. 13, no. 7, p. 176, 2021.

M. Rahman and K. Alam, “Adaptive ensemble approaches for non-linear sales data forecasting,” Applied Intelligence, vol. 50, pp. 1234–1247, 2020.

S. Hochreiter and J. Schmidhuber, “Long Short-Term Memory,” Neural Comput., vol. 9, no. 8, pp. 1735–1780, Nov. 1997, doi: 10.1162/neco.1997.9.8.1735.

B. Lim and S. Zohren, “Time-series forecasting with deep learning: a survey,” Philosophical transactions of the royal society a: mathematical, physical and engineering sciences, vol. 379, no. 2194, 2021.

S. Siami-Namini, N. Tavakoli, and A. S. Namin, “A comparison of ARIMA and LSTM in forecasting time series,” in 2018 17th IEEE international conference on machine learning and applications (ICMLA), Ieee, 2018, pp. 1394–1401.

J. Choi and S. Lim, “Smart vending systems with cloud and IoT integration,” IEEE Access, vol. 7, pp. 123456–123467, 2019.

J. Martinez and A. Lopez, “Hybrid machine learning models for demand forecasting in retail,” Decis. Support Syst., vol. 140, p. 113429, 2021.

P. Shah and S. Verma, “IoT and AI-based inventory management for smart vending,” IEEE Trans. Industr. Inform., vol. 17, no. 9, pp. 6324–6332, 2021.

Y. Sun and X. Wang, “Predictive modeling of product demand using hybrid ML and DL,” Knowl. Based. Syst., vol. 194, p. 105596, 2020.

K. Rao and M. Singh, “Real-time analytics in IoT-enabled vending systems,” Sensors, vol. 21, no. 9, p. 3056, 2021.

T. Chen and C. Guestrin, “XGBoost for time series forecasting: Applications in sales data,” IEEE Trans. Knowl. Data Eng., vol. 31, no. 11, pp. 2089–2101, 2019.

M. K. Anam et al., “Sara Detection on Social Media Using Deep Learning Algorithm Development,” Journal of Applied Engineering and Technological Science (JAETS), vol. 6, no. 1, pp. 225–237, Dec. 2024, doi: 10.37385/jaets.v6i1.5390.

D. Setiawan, R. N. Putri, I. Fitri, A. N. Hidayanto, Y. Irawan, and N. Hohashi, “Improved Deep Learning Model for Prediction of Dermatitis in Infants,” Journal of Applied Data Sciences, vol. 6, no. 2, pp. 871–884, 2025, doi: 10.47738/jads.v6i2.542.

D. Jepisah, H. Octaria, Muhamadiah, and Y. Irawan, “YOLOv12 Model Optimization for Monitoring Occupational Health and Safety in Hospital Archive Rooms,” Journal of Applied Data Sciences, vol. 6, no. 4, pp. 2666–2681, 2025, doi: https://doi.org/10.47738/jads.v6i4.936.

B. Kurniawan, R. Wahyuni, Y. Irawan, and M. H. Yuhandri, “Multimodal Deep Learning and IoT Sensor Fusion for Real-Time Beef Freshness Detection,” Journal of Applied Data Sciences, vol. 6, no. 4, pp. 2921–2937, 2025.

D. Setiawan, R. N. Putri, S. Herlina, A. N. Hidayanto, Y. Irawan, and N. Hohashi, “A Hybrid YOLO–CNN Model for Automatic Detection and Severity Assessment of Atopic Dermatitis in Infant Images,” Journal of Applied Data Sciences; Vol 7, No 2: May 2026DO - 10.47738/jads.v7i2.1212 , Apr. 2026, [Online]. Available: https://www.bright-journal.org/Journal/index.php/JADS/article/view/1212

V. Patel and A. Desai, “Support vector regression for retail sales prediction,” Int. J. Inf. Manage., vol. 50, pp. 34–42, 2020.

T. Li and Y. Zhao, “Sales forecasting with IoT-enhanced machine learning,” J. Ambient Intell. Humaniz. Comput., vol. 12, pp. 7895–7908, 2021.

A. Fernandez and S. Garcia, “A survey on ensemble learning methods for time series forecasting,” ACM Comput. Surv., vol. 53, no. 4, pp. 1–36, 2020.

A. Singh and R. Kumar, “Hyperparameter optimization for deep learning models using Optuna,” IEEE Access, vol. 8, pp. 116295–116307, 2020.

D. Yang and F. Xu, “LSTM networks for time series prediction in smart retail,” Neurocomputing, vol. 366, pp. 123–131, 2019.

S. Park and H. Kim, “Deep learning for vending machine demand forecasting with IoT integration,” IEEE Internet Things J., vol. 8, no. 7, pp. 5632–5645, 2021.

H. Liu and M. Zhou, “Stacking ensemble models for improved sales prediction,” Appl. Soft Comput., vol. 92, p. 106310, 2020.

R. Gupta and P. Sharma, “Ensemble learning for time series forecasting in IoT-enabled smart environments,” Future Generation Computer Systems, vol. 115, pp. 180–192, 2021.

R. Sovia, Y. Irawan, I. A. Wisky, M. H. Yuhandri, and R. Permana, “MLSEL: A tuned multilayer stacking ensemble learning with meta feature for flood risk prediction,” Engineering and Applied Science Research, vol. 53, no. 2 SE-ORIGINAL RESEARCH, pp. 211–222, Apr. 2026, doi: 10.64960/easr.2026.263071.

Y. Irawan, S. Defit, and R. Sovia, “Optimizing Stacking Ensemble Learning to Enhance Meta-Model Performance in Forest Fire Risk Level Detection,” 2025 1st International Conference on Emerging Trends in Information Systems and Informatics (ICETISI), pp. 1–6, 2025, doi: 10.1109/ICETISI67983.2025.11406049.

Y. Zhang and X. Chen, “Forecasting sales with machine learning: A case study in retail,” Expert Syst. Appl., vol. 133, pp. 1–12, 2019.

L. Wang and J. Li, “IoT-enabled vending machine for intelligent retailing,” IEEE Access, vol. 8, pp. 123456–123467, 2020.

W. Li and K. L. E. Law, “Deep learning models for time series forecasting: A review,” IEEE Access, vol. 12, pp. 92306–92327, 2024.

X. Liu and W. Wang, “Deep time series forecasting models: A comprehensive survey,” Mathematics, vol. 12, no. 10, p. 1504, 2024.

Herianto, B. Kurniawan, Z. H. Hartomi, Y. Irawan, and M. K. Anam, “Machine Learning Algorithm Optimization using Stacking Technique for Graduation Prediction,” Journal of Applied Data Sciences, vol. 5, no. 3, pp. 1272–1285, 2024.

H. Fonda, Y. Irawan, R. Melyanti, R. Wahyuni, and A. Muhaimin, “A Comprehensive Stacking Ensemble Approach for Stress Level Classification in Higher Education,” Journal of Applied Data Sciences, vol. 5, no. 4, pp. 1701–1714, 2024.

Y. Devis, Muhamadiah, Yulanda, Y. Irawan, and R. Wahyuni, “Optimization of Machine Learning Models for Risk Prediction of DHF Spread to Support Management Strategies in Urban Areas,” Journal of Applied Data Sciences, vol. 6, no. 4, pp. 2407–2420, 2025, doi: 10.47738/jads.v6i4.898.

Y. Irawan, S. Defit, and R. Sovia, “Rotational Stacking Ensemble with Accuracy-Based Weighting for Real-Time Forest Fire Risk Prediction,” International Journal of Robotics and Control Systems, vol. 6, no. 3, May 2026, doi: https://doi.org/10.31763/ijrcs.v6i3.2741.

A. Lubis, Y. Irawan, Junadhi, and S. Defit, “Leveraging K-Nearest Neighbors with SMOTE and Boosting Techniques for Data Imbalance and Accuracy Improvement,” Journal of Applied Data Sciences, vol. 5, no. 4, pp. 1625–1638, 2024, doi: 10.47738/jads.v5i4.343.

R. M. Sari, E. Sabna, R. Wahyuni, and Y. Irawan, “Implementation of open and close a housing gate portal using RFID card,” Journal of Robotics and Control (JRC), vol. 2, no. 5, pp. 363–367, Sep. 2021, doi: 10.18196/jrc.25108.




DOI: https://doi.org/10.47738/jads.v7i3.1395

Refbacks

  • There are currently no refbacks.



Barcode

Journal of Applied Data Sciences

ISSN : 2723-6471 (Online)
Publisher : Bright Publisher
Website : http://bright-journal.org/JADS
Email : taqwa@amikompurwokerto.ac.id (principal contact)
    support@bright-journal.org (technical issues)

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0