An Application of Ensemble Stacking in Machine Learning to Predict Short-term Electricity Demand in South Africa

  • Claris Shoko Department of Statistics, University of Botswana, Gaborone, Botswana
  • Caston Sigauke Department of Mathematical and Computational Sciences, University of Venda, Thohoyandou, South Africa
  • Katleho Makatjane Department of Statistics, University of Botswana, Gaborone, Botswana
Keywords: Deep neural network, electricity demand, gradient boosting machine, random forest, stacking-ensemble, South Africa

Abstract

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.
Published
2025-03-28
How to Cite
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. https://doi.org/10.19139/soic-2310-5070-2170
Section
Research Articles