An Application of Ensemble Stacking in Machine Learning to Predict Short-term Electricity Demand in South Africa - Claris Shoko; Caston Sigauke; Katleho Makatjane (Statistics, Optimization & Information Computing, 2025)
The massive increase in the collected data and the need for data mining and analyses has prompted the need to improve the accuracy and stability of traditional data mining and learning algorithms. This study proposes a robust stacking-ensemble algorithm for predicting the hourly electricity demand in South Africa. The structure of the proposed model is in two layers: the base model and the meta-model. Four machine learning models, that is, the gradient boosting machine (GBM), the deep neural network (DNN), the generalised linear model (GLM), and the random forest (RF), make up the base models. Output from the base models is integrated using ensemble stacking to form the meta-model. The stacking-ensemble (SE) model predicts South Africa's hourly electricity demand. The performance of the models is tested in different forecasting horizons. The prediction performance of the stacking-ensemble model is compared with the prediction performance of each of the base models using the root mean square error (RMSE), the mean absolute error (MAE), and the mean square error (MSE). In addition, the Giacomini-White test is used to identify the dominant model. Results showed that the RF model produced the most accurate predictions in all the forecasting horizons. The order of dominance is as follows: RF> SE > GBM> GLM. Thus, RF demonstrates the highest predictive capability, dominating the other models. The stacking-ensemble model produced the second most accurate results, with its results in the shortest forecasting horizon almost equal to that of the RF model. Thus, in this context, the stacking ensemble performs better than 3 of the 4 meta models. The proposed model produces a reasonable and accurate prediction of hourly electricity demand, which is strategically significant in planning and formulating electricity load-shedding strategies in South Africa or any other country.