An Improved Ensemble Learning Regression Algorithm for Electricity Demand Forecasting with Symmetric Experimental Evaluation
Abstract
1. Introduction
- (1)
- We propose a novel DK-Stacking algorithm for electricity load forecasting, which combines D2-Sampling- and KNN-based sampling strategies to enhance the diversity of the base datasets, thereby improving the robustness and generalization ability of the ensemble models.
- (2)
- The DK-Stacking algorithm integrates multiple heterogeneous base learners via the stacking strategy, effectively reducing overfitting and improving the forecasting accuracy across different load types and scenarios.
- (3)
- Extensive experiments on real electricity load datasets from multiple regions demonstrate that the proposed DK-Stacking algorithm outperforms conventional machine learning models (SVR, ANN, RF, XGBoost) and existing ensemble methods in terms of both the prediction accuracy and stability.
2. Related Works
2.1. Machine Learning Methods for Electricity Demand Forecasting
2.2. Stacking Ensemble Learning Algorithm
3. DK-Stacking Algorithom
3.1. D2-Sampling Selection Probability
3.2. KNN Selection Probability
3.3. DK’s Sampling Bagging Strategy
- (1)
- For the first base dataset , the selection probability of each sample point is assigned according to Equation (6). A starting point is randomly selected based on this selection probability. The remaining sample points are assigned selection probabilities according to Equation (7), and a point outside the set that is not in the training set is randomly selected as the second point of the base training set . This process is repeated to select , until approximately 70% of the points in the training set are selected to enter the base training set .
- (2)
- After the previous base data set collection is selected, the next base data set collection points will be chosen. The of the next set is the last sample point of the previous set. The remaining selection operations are the same as those in step 1, and so on. The selection of subsequent base training set points is carried out in the same way.
| Algorithm 1: DK-Stacking Algorithm |
| Input: Dataset with samples and features. Number of base datasets . Size of base dataset (typically 70% of total). Number of neighbors for KNN. First-layer base models: ANN, SVR, RF, XGBoost. Second-layer meta-model: XGBoost. Output: Final prediction for test samples. Procedure: 1: Initialize empty base dataset 2: Compute D2-Sampling probabilities using Equations (1)–(2) 3: Compute KNN-based probabilities using Equations (3)–(6) 4: Compute final selection probability for each sample using Equation (7) 5: for to , generate base datasets 6: if then randomly select starting sample based on 7: else of current base dataset = last sample of previous base dataset 8: repeat 9: Select sample based on 10: Add to 11: until base dataset reaches samples 12: Train first-layer base models (ANN, SVR, RF, XGBoost) on base dataset 13: end for 14: Collect predictions from all first-layer models on training and validation sets 15: Integrate predictions as input features for second-layer XGBoost meta-model 16: Train second-layer XGBoost model using 5-fold cross-validation and grid search 17: Output final prediction for test samples |
4. Experimental Studies
4.1. Datasets and Preprocessing
4.2. Parameter Settings and Model Evaluation
4.3. Experimental Results
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Habbak, H.; Mahmoud, M.; Metwally, K.; Fouda, M.M.; Ibrahem, M.I. Load Forecasting Techniques and Their Applications in Smart Grids. Energies 2023, 16, 1480. [Google Scholar] [CrossRef]
- Nti, I.K.; Teimeh, M.; Nyarko-Boateng, O.; Adekoya, A.F. Electricity load forecasting: A systematic review. J. Electr. Syst. Inf. Technol. 2020, 7, 13. [Google Scholar] [CrossRef]
- Bakare, M.S.; Abdulkarim, A.; Zeeshan, M.; Shuaibu, A.N. A comprehensive overview on demand side energy management towards smart grids: Challenges, solutions, and future direction. Energy Inform. 2023, 6, 4. [Google Scholar] [CrossRef]
- Hasan, M.; Mifta, Z.; Papiya, S.J.; Roy, P.; Dey, P.; Salsabil, N.A.; Chowdhury, N.-U.; Farrok, O. A state-of-the-art comparative review of load forecasting methods: Characteristics, perspectives, and applications. Energy Convers. Manag. X 2025, 26, 100922. [Google Scholar] [CrossRef]
- Zhong, B. Deep learning integration optimization of electric energy load forecasting and market price based on the ANN–LSTM–transformer method. Front. Energy Res. 2023, 11, 1292204. [Google Scholar] [CrossRef]
- McSharry, P.E.; Bouwman, S.; Bloemhof, G. Probabilistic Forecasts of the Magnitude and Timing of Peak Electricity Demand. IEEE Trans. Power Syst. 2005, 20, 1166–1172. [Google Scholar] [CrossRef]
- Mir, A.A.; Alghassab, M.; Ullah, K.; Khan, Z.A.; Lu, Y.; Imran, M. A Review of Electricity Demand Forecasting in Low and Middle Income Countries: The Demand Determinants and Horizons. Sustainability 2020, 12, 5931. [Google Scholar] [CrossRef]
- Velasquez, C.E.; Zocatelli, M.; Estanislau, F.B.G.L.; Castro, V.F. Analysis of time series models for Brazilian electricity demand forecasting. Energy 2022, 247, 123483. [Google Scholar] [CrossRef]
- Li, R.; Jiang, P.; Yang, H.; Li, C. A novel hybrid forecasting scheme for electricity demand time series. Sustain. Cities Soc. 2020, 55, 102036. [Google Scholar] [CrossRef]
- Tarmanini, C.; Sarma, N.; Gezegin, C.; Ozgonenel, O. Short term load forecasting based on ARIMA and ANN approaches. Energy Rep. 2023, 9, 550–557. [Google Scholar] [CrossRef]
- Anh, N.T.N.; Anh, N.N.; Thang, T.N.; Solanki, V.K.; Crespo, R.G.; Dat, N.Q. Online SARIMA applied for short-term electricity load forecasting. Appl. Intell. 2023, 54, 1003–1019. [Google Scholar] [CrossRef]
- Jiang, J.; Zhao, W.; Ou, M.; Wang, T.; Huang, G. The Practical Engineering Application of Improved Grey Prediction Model in Power Load Forecasting. In Proceedings of the 2023 3rd International Conference on Intelligent Power and Systems (ICIPS), Shenzhen, China, 20–22 October 2023; pp. 193–199. [Google Scholar] [CrossRef]
- Lee, J.; Cho, Y. National-scale electricity peak load forecasting: Traditional, machine learning, or hybrid model? Energy 2022, 239, 122366. [Google Scholar] [CrossRef]
- Sayed, H.A.; William, A.; Said, A.M. Smart Electricity Meter Load Prediction in Dubai Using MLR, ANN, RF, and ARIMA. Electronics 2023, 12, 389. [Google Scholar] [CrossRef]
- Matrenin, P.; Safaraliev, M.; Dmitriev, S.; Kokin, S.; Ghulomzoda, A.; Mitrofanov, S. Medium-term load forecasting in isolated power systems based on ensemble machine learning models. Energy Rep. 2022, 8, 612–618. [Google Scholar] [CrossRef]
- Yamasaki, M.; Freire, R.Z.; Seman, L.O.; Stefenon, S.F.; Mariani, V.C.; Coelho, L.d.S. Optimized hybrid ensemble learning approaches applied to very short-term load forecasting. Int. J. Electr. Power Energy Syst. 2024, 155, 109579. [Google Scholar] [CrossRef]
- Zhang, Q.; Wu, J.; Ma, Y.; Li, G.; Ma, J.; Wang, C. Short-term load forecasting method with variational mode decomposition and stacking model fusion. Sustain. Energy Grids Netw. 2022, 30, 100622. [Google Scholar] [CrossRef]
- Guo, F.; Mo, H.; Wu, J.; Pan, L.; Zhou, H.; Zhang, Z.; Li, L.; Huang, F. A Hybrid Stacking Model for Enhanced Short-Term Load Forecasting. Electronics 2024, 13, 2719. [Google Scholar] [CrossRef]
- Jaiswal, R.; Kumar, M.; Sen, S. Improved analysis of D2-sampling based PTAS for k-means and other clustering problems. Inf. Process. Lett. 2015, 115, 100–103. [Google Scholar] [CrossRef]
- Zhang, S.; Li, X.; Zong, M.; Zhu, X.; Wang, R. Efficient kNN Classification With Different Numbers of Nearest Neighbors. IEEE Trans. Neural Netw. Learn. Syst. 2018, 29, 1774–1785. [Google Scholar] [CrossRef]
- Sun, Y.; Huang, B.; Ullah, A.; Wang, S. Nonparametric estimation and forecasting of interval-valued time series regression models with constraints. Expert Syst. Appl. 2024, 249, 123385. [Google Scholar] [CrossRef]
- Huanyu, C.; Qilong, H.; Nianbin, W.; Ye, W. An adaptive approach for compression format based on bagging algorithm. Int. J. Parallel Emergent Distrib. Syst. 2023, 38, 401–423. [Google Scholar] [CrossRef]
- Chen, Y.; Xu, P.; Chu, Y.; Li, W.; Wu, Y.; Ni, L.; Bao, Y.; Wang, K. Short-term electrical load forecasting using the Support Vector Regression (SVR) model to calculate the demand response baseline for office buildings. Appl. Energy 2017, 195, 659–670. [Google Scholar] [CrossRef]
- Liu, Y. Prediction of Structural Damage Trends Based on the Integration of LSTM and SVR. Appl. Sci. 2023, 13, 7135. [Google Scholar] [CrossRef]
- Zheng, J.; Liu, C.; Huang, S.; He, Y. A novel adaptive dynamic GA combined with AM to optimize ANN for multi-output prediction: Small samples enhanced in industrial processing. Inf. Sci. 2023, 644, 119285. [Google Scholar] [CrossRef]
- Aasi, H.K.; Mishra, M. Investigation on cross-flow three-fluid compact heat exchanger under flow non-uniformity: An experimental study with ANN prediction. Exp. Heat Transf. 2022, 36, 688–718. [Google Scholar] [CrossRef]
- Román-Portabales, A.; López-Nores, M.; Pazos-Arias, J.J. Systematic Review of Electricity Demand Forecast Using ANN-Based Machine Learning Algorithms. Sensors 2021, 21, 4544. [Google Scholar] [CrossRef]
- Pappas, S.; Ekonomou, L.; Karampelas, P.; Karamousantas, D.; Katsikas, S.; Chatzarakis, G.; Skafidas, P. Electricity demand load forecasting of the Hellenic power system using an ARMA model. Electr. Power Syst. Res. 2010, 80, 256–264. [Google Scholar] [CrossRef]
- Zhao, H.; Guo, S. An optimized grey model for annual power load forecasting. Energy 2016, 107, 272–286. [Google Scholar] [CrossRef]
- Chen, J.-F.; Wang, W.-M.; Huang, C.-M. Analysis of an adaptive time-series autoregressive moving-average (ARMA) model for short-term load forecasting. Electr. Power Syst. Res. 1995, 34, 187–196. [Google Scholar] [CrossRef]
- Chen, Y.; Kloft, M.; Yang, Y.; Li, C.; Li, L. Mixed kernel based extreme learning machine for electric load forecasting. Neurocomputing 2018, 312, 90–106. [Google Scholar] [CrossRef]
- Chen, G.; Hu, Q.; Wang, J.; Wang, X.; Zhu, Y. Machine-Learning-Based Electric Power Forecasting. Sustainability 2023, 15, 11299. [Google Scholar] [CrossRef]
- Aprillia, H.; Yang, H.-T.; Huang, C.-M. Short-Term Photovoltaic Power Forecasting Using a Convolutional Neural Network–Salp Swarm Algorithm. Energies 2020, 13, 1879. [Google Scholar] [CrossRef]
- Miraki, A.; Parviainen, P.; Arghandeh, R. Electricity demand forecasting at distribution and household levels using explainable causal graph neural network. Energy AI 2024, 16, 100368. [Google Scholar] [CrossRef]
- Tiwari, S.; Jain, A.; Ahmed, N.M.O.S.; Charu; Alkwai, L.M.; Dafhalla, A.K.Y.; Hamad, S.A.S. Machine learning-based model for prediction of power consumption in smart grid-smart way towards smart city. Expert Syst. 2021, 39, e12832. [Google Scholar] [CrossRef]
- Ahmad, T.; Zhang, H.; Yan, B. A review on renewable energy and electricity requirement forecasting models for smart grid and buildings. Sustain. Cities Soc. 2020, 55, 102052. [Google Scholar] [CrossRef]
- Solyali, D. A Comparative Analysis of Machine Learning Approaches for Short-/Long-Term Electricity Load Forecasting in Cyprus. Sustainability 2020, 12, 3612. [Google Scholar] [CrossRef]
- Jawad, M.; Nadeem, M.S.A.; Shim, S.-O.; Khan, I.R.; Shaheen, A.; Habib, N.; Hussain, L.; Aziz, W. Machine Learning Based Cost Effective Electricity Load Forecasting Model Using Correlated Meteorological Parameters. IEEE Access 2020, 8, 146847–146864. [Google Scholar] [CrossRef]










| Serial Number | Data Field |
|---|---|
| 1 | date and time |
| 2 | electric load (MV) |
| 3 | maximum temperature °C |
| 4 | minimum temperature °C |
| 5 | average temperature °C |
| 6 | relative humidity (average) |
| 7 | rainfall (mm) |
| Data Field | Description |
|---|---|
| Date | Date; Date variable |
| Demand | Daily total power demand; continuous variable |
| RRP | Suggested retail price; continuous variable |
| demand_pos_RRP | The daily total demand quantity with a positive retail price; continuous variable |
| RRP_positive | Average retail price; continuous variable |
| demand_neg_RRP | The daily total demand quantity with a negative retail price; continuous variable |
| RRP_negative | Average negative retail price; continuous variable |
| frac_at_neg_RRP | The portion of negative retail price transactions; continuous variable |
| min_temperature | Daytime minimum temperature; continuous variable |
| max_temperature | Daytime maximum temperature; continuous variable |
| solar_exposure | Daily total solar energy; continuous variable |
| rainfall | Daily rainfall amount; continuous variable |
| school_day | Whether the student is at school; Categorical variable |
| holiday | Is it a holiday (Categorical variable) |
| Method | MAPE of Forecasting Results (%) |
|---|---|
| ANN | 11.51 |
| SVR | 11.52 |
| RF | 9.88 |
| XGBoost | 9.61 |
| DK-Stacking | 9.57 |
| Method | MAPE of Forecasting Results (%) |
|---|---|
| ANN | 12.85 |
| SVR | 12.71 |
| RF | 13.57 |
| XGBoost | 12.59 |
| DK-Stacking | 12.24 |
| Method | MAPE of Forecasting Results (%) |
|---|---|
| ANN | 8.73 |
| SVR | 8.29 |
| RF | 8.09 |
| XGBoost | 7.41 |
| DK-Stacking | 6.97 |
| Method | Region 1 | Region 2 | Region 3 |
|---|---|---|---|
| MAPE of Forecasting Results (%) | MAPE of Forecasting Results (%) | MAPE of Forecasting Results (%) | |
| ANN | 12.85 | 11.51 | 8.73 |
| SVR | 12.71 | 11.52 | 8.29 |
| RF | 13.57 | 9.88 | 8.09 |
| XGBoost | 12.59 | 9.61 | 7.41 |
| DK-Stacking | 12.24 | 9.57 | 6.97 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Zhou, J.; Yan, P.; Bian, Z.; Jiang, Z.; Yu, D. An Improved Ensemble Learning Regression Algorithm for Electricity Demand Forecasting with Symmetric Experimental Evaluation. Symmetry 2026, 18, 123. https://doi.org/10.3390/sym18010123
Zhou J, Yan P, Bian Z, Jiang Z, Yu D. An Improved Ensemble Learning Regression Algorithm for Electricity Demand Forecasting with Symmetric Experimental Evaluation. Symmetry. 2026; 18(1):123. https://doi.org/10.3390/sym18010123
Chicago/Turabian StyleZhou, Jie, Peisheng Yan, Zekang Bian, Zhibin Jiang, and Donghua Yu. 2026. "An Improved Ensemble Learning Regression Algorithm for Electricity Demand Forecasting with Symmetric Experimental Evaluation" Symmetry 18, no. 1: 123. https://doi.org/10.3390/sym18010123
APA StyleZhou, J., Yan, P., Bian, Z., Jiang, Z., & Yu, D. (2026). An Improved Ensemble Learning Regression Algorithm for Electricity Demand Forecasting with Symmetric Experimental Evaluation. Symmetry, 18(1), 123. https://doi.org/10.3390/sym18010123
