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 (Bright Publisher, 2026)
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.