
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Enhancing Model Trust in Load Forecasting using Counterfactual Explanations
Corresponding Author(s) : Muhammad Syarif Hidayatullah
Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control,
Vol. 11, No. 4, November 2026 (Article in Progress)
Abstract
This study investigates the effectiveness of Counterfactual Explanations (CE) in improving the interpretability of short-term electricity load forecasting models. The forecasting model was developed using Random Forest Regression (RFR) due to its ability to capture nonlinear multivariate patterns in electricity load data and to provide global, descriptive interpretability through feature-importance analysis. However, feature importance provides static and potentially biased explanations, making it insufficient for instance-level interpretability. To address this limitation, the Diverse Counterfactual Explanations (DiCE) framework was integrated to generate multiple “what-if” scenarios that illustrate model-consistent input adjustments capable of shifting forecast outcomes. The study uses hourly electricity load data from Panama collected between 2015 and 2020, with data from 2020 excluded during preprocessing due to atypical demand patterns caused by COVID-19. The model was trained using time-series cross-validation and optimized through grid search. Forecasting performance was evaluated using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and Mean Absolute Percentage Error (MAPE). Counterfactual Explanations were assessed using validity, proximity, and compactness metrics, indicating that most generated scenarios are goal-aligned and remain moderately close to the original instances, while the compactness results reflect a feasibility trade-off when large prediction shifts are required. Overall, combining RFR with counterfactual analysis enhances model transparency by bridging global and local interpretability perspectives and provides decision-relevant, scenario-based insights to support transparent and data-driven planning in the energy sector.
Keywords
Download Citation
Endnote/Zotero/Mendeley (RIS)BibTeX
- A. Khan and M. Rizwan, “Load Forecasting Using Different Techniques,” Lecture Notes in Electrical Engineering, vol. 956, pp. 131 – 151, 2023, doi: 10.1007/978-981-19-6490-9_8.
- R. Chandrasekaran and S. K. Paramasivan, “Advances in Deep Learning Techniques for Short-term Energy Load Forecasting Applications: A Review,” Archives of Computational Methods in Engineering, vol. 32, no. 2, pp. 663 – 692, 2025, doi: 10.1007/s11831-024-10155-x.
- V. Hassija et al., “Interpreting Black-Box Models: A Review on Explainable Artificial Intelligence,” Jan. 01, 2024, Springer. doi: 10.1007/s12559-023-10179-8.
- X. Yuan, S. Liu, W. Feng, and G. Dauphin, “Feature Importance Ranking of Random Forest-Based End-to-End Learning Algorithm,” Remote Sens. (Basel)., vol. 15, no. 21, Nov. 2023, doi: 10.3390/rs15215203.
- F. Cappelli, G. Castronuovo, S. Grimaldi, and V. Telesca, “Random Forest and Feature Importance Measures for Discriminating the Most Influential Environmental Factors in Predicting Cardiovascular and Respiratory Diseases,” Int. J. Environ. Res. Public Health, vol. 21, no. 7, Jul. 2024, doi: 10.3390/ijerph21070867.
- B. Magalhães, P. Bento, J. Pombo, M. do R. Calado, and S. Mariano, “Short-Term Load Forecasting Based on Optimized Random Forest and Optimal Feature Selection,” Energies (Basel)., vol. 17, no. 8, 2024, doi: 10.3390/en17081926.
- S. Zhao, “Urban Electricity Consumption Forecasting Based on SARIMA and Random Forest Modeling,” Journal of Electrotechnology, Electrical Engineering and Management, vol. 7, no. 1, 2024, doi: 10.23977/jeeem.2024.070115.
- B. Yang, M. Gül, and Y. Chen, “Comparative analysis of deep learning and tree-based models in power demand prediction: Accuracy, interpretability, and computational efficiency,” J. Build. Phys., vol. 49, no. 1 Special Issue: eSim2024, part one, pp. 127–169, Jul. 2025, doi: 10.1177/17442591251333144.
- N. J. Johannesen, M. Kolhe, and M. Goodwin, “Relative evaluation of regression tools for urban area electrical energy demand forecasting,” J. Clean. Prod., vol. 218, pp. 555 – 564, 2019, doi: 10.1016/j.jclepro.2019.01.108.
- M. L. Wallace et al., “Use and misuse of random forest variable importance metrics in medicine: demonstrations through incident stroke prediction,” BMC Med. Res. Methodol., vol. 23, no. 1, 2023, doi: 10.1186/s12874-023-01965-x.
- H. Prabhu, A. Sane, R. Dhadwal, N. R. Parlikkad, and J. K. Valadi, “Interpretation of Drop Size Predictions from a Random Forest Model Using Local Interpretable Model-Agnostic Explanations (LIME) in a Rotating Disc Contactor,” Ind. Eng. Chem. Res., 2023, doi: 10.1021/acs.iecr.3c00808.
- R. Guidotti, “Counterfactual explanations and how to find them: literature review and benchmarking,” Data Min. Knowl. Discov., vol. 38, no. 5, pp. 2770–2824, Sep. 2024, doi: 10.1007/s10618-022-00831-6.
- F. Cheng, Y. Ming, and H. Qu, “DECE: Decision Explorer with Counterfactual Explanations for Machine Learning Models,” IEEE Trans. Vis. Comput. Graph., vol. 27, no. 2, pp. 1438–1447, 2021, doi: 10.1109/TVCG.2020.3030342.
- J. Höllig, A. F. Markus, J. de Slegte, and P. Bagave, Semantic Meaningfulness: Evaluating Counterfactual Approaches for Real-World Plausibility and Feasibility, vol. 1902 CCIS. 2023. doi: 10.1007/978-3-031-44067-0_32.
- P. Rakesh, J. R. Shruti, I. Thippeswamy, B. L. Nithya, and V. Dheeraj, “A Surrogate Approach to Explainable AI for Predictive Maintenance: Techniques and Applications,” in 5th International Conference on Circuits, Control, Communication and Computing, I4C 2024, 2024, pp. 160 – 165. doi: 10.1109/I4C62240.2024.10748524.
- A. L. Alfeo and M. G. C. A. Cimino, “Counterfactual-Based Feature Importance for Explainable Regression of Manufacturing Production Quality Measure,” in International Conference on Pattern Recognition Applications and Methods, 2024, pp. 48–56. doi: 10.5220/0012369600003654.
- L. Celar and R. M. J. Byrne, “How people reason with counterfactual and causal explanations for Artificial Intelligence decisions in familiar and unfamiliar domains,” Mem. Cognit., vol. 51, no. 7, pp. 1481–1496, 2023, doi: 10.3758/s13421-023-01407-5.
- P. M. Vannostrand, D. M. Hofmann, L. Ma, B. Genin, R. Huang, and E. A. Rundensteiner, “Counterfactual Explanation Analytics: Empowering Lay Users to Take Action Against Consequential Automated Decisions,” Proceedings of the VLDB Endowment, vol. 17, no. 12, pp. 4349–4352, 2024, doi: 10.14778/3685800.3685872.
- Z. Wang, I. Miliou, I. Samsten, and P. Papapetrou, “Counterfactual Explanations for Time Series Forecasting,” in Proceedings - IEEE International Conference on Data Mining, ICDM, 2023, pp. 1391–1396. doi: 10.1109/ICDM58522.2023.00180.
- G. Zuin and A. Veloso, “Navigating Time’s Possibilities: Plausible Counterfactual Explanations for Multivariate Time-Series Forecast through Genetic Algorithms,” in 2024 IEEE 23rd International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom), IEEE, Dec. 2024, pp. 2575–2582. doi: 10.1109/TrustCom63139.2024.00359.
- D. You et al., “Counterfactual explanation generation with minimal feature boundary,” Inf. Sci. (N Y)., vol. 625, pp. 342 – 366, 2023, doi: 10.1016/j.ins.2023.01.012.
- J. Liu, X. Wu, S. Liu, and S. Gong, “Model-agnostic counterfactual explanation: A feature weights-based comprehensive causal multi-objective counterfactual framework,” Expert Syst. Appl., vol. 266, Mar. 2025, doi: 10.1016/j.eswa.2024.126063.
- Y. Yuan, K. McAreavey, S. Li, and W. Liu, “Multi-Granular Evaluation of Diverse Counterfactual Explanations,” in International Conference on Agents and Artificial Intelligence, Science and Technology Publications, Lda, 2024, pp. 186–197. doi: 10.5220/0012349900003636.
- G. Dudek, “Short-term load forecasting using random forests,” Advances in Intelligent Systems and Computing, vol. 323, pp. 821 – 828, 2015, doi: 10.1007/978-3-319-11310-4_71.
- X. Wu, J. He, P. Zhang, and J. Hu, “Power system short-term load forecasting based on improved random forest with grey relation projection,” Dianli Xitong Zidonghua/Automation of Electric Power Systems, vol. 39, no. 12, pp. 50 – 55, 2015, doi: 10.7500/AEPS20140916005.
- A. M. Ernesto, “Short-term electricity load forecasting (Panama case study),” Mendeley Data, no. V1, 2021, doi: 10.17632/byx7sztj59.1.
- A. Soriano-Vargas et al., “A visual analytics approach to anomaly detection in hydrocarbon reservoir time series data,” J. Pet. Sci. Eng., vol. 206, 2021, doi: 10.1016/j.petrol.2021.108988.
- S. M. Ghazali, N. Shaadan, and Z. Idrus, “Missing data exploration in air quality data set using r-package data visualisation tools,” Bulletin of Electrical Engineering and Informatics, vol. 9, no. 2, pp. 755 – 763, 2020, doi: 10.11591/eei.v9i2.2088.
- N. Bui, D. Nguyen, and V. A. Nguyen, “Counterfactual Plans Under Distributional Ambiguity,” in ICLR 2022 - 10th International Conference on Learning Representations, 2022. doi: 10.48550/arXiv.2201.12487.
- M. Virgolin and S. Fracaros, “On the robustness of sparse counterfactual explanations to adverse perturbations,” Artif. Intell., vol. 316, 2023, doi: 10.1016/j.artint.2022.103840.
References
A. Khan and M. Rizwan, “Load Forecasting Using Different Techniques,” Lecture Notes in Electrical Engineering, vol. 956, pp. 131 – 151, 2023, doi: 10.1007/978-981-19-6490-9_8.
R. Chandrasekaran and S. K. Paramasivan, “Advances in Deep Learning Techniques for Short-term Energy Load Forecasting Applications: A Review,” Archives of Computational Methods in Engineering, vol. 32, no. 2, pp. 663 – 692, 2025, doi: 10.1007/s11831-024-10155-x.
V. Hassija et al., “Interpreting Black-Box Models: A Review on Explainable Artificial Intelligence,” Jan. 01, 2024, Springer. doi: 10.1007/s12559-023-10179-8.
X. Yuan, S. Liu, W. Feng, and G. Dauphin, “Feature Importance Ranking of Random Forest-Based End-to-End Learning Algorithm,” Remote Sens. (Basel)., vol. 15, no. 21, Nov. 2023, doi: 10.3390/rs15215203.
F. Cappelli, G. Castronuovo, S. Grimaldi, and V. Telesca, “Random Forest and Feature Importance Measures for Discriminating the Most Influential Environmental Factors in Predicting Cardiovascular and Respiratory Diseases,” Int. J. Environ. Res. Public Health, vol. 21, no. 7, Jul. 2024, doi: 10.3390/ijerph21070867.
B. Magalhães, P. Bento, J. Pombo, M. do R. Calado, and S. Mariano, “Short-Term Load Forecasting Based on Optimized Random Forest and Optimal Feature Selection,” Energies (Basel)., vol. 17, no. 8, 2024, doi: 10.3390/en17081926.
S. Zhao, “Urban Electricity Consumption Forecasting Based on SARIMA and Random Forest Modeling,” Journal of Electrotechnology, Electrical Engineering and Management, vol. 7, no. 1, 2024, doi: 10.23977/jeeem.2024.070115.
B. Yang, M. Gül, and Y. Chen, “Comparative analysis of deep learning and tree-based models in power demand prediction: Accuracy, interpretability, and computational efficiency,” J. Build. Phys., vol. 49, no. 1 Special Issue: eSim2024, part one, pp. 127–169, Jul. 2025, doi: 10.1177/17442591251333144.
N. J. Johannesen, M. Kolhe, and M. Goodwin, “Relative evaluation of regression tools for urban area electrical energy demand forecasting,” J. Clean. Prod., vol. 218, pp. 555 – 564, 2019, doi: 10.1016/j.jclepro.2019.01.108.
M. L. Wallace et al., “Use and misuse of random forest variable importance metrics in medicine: demonstrations through incident stroke prediction,” BMC Med. Res. Methodol., vol. 23, no. 1, 2023, doi: 10.1186/s12874-023-01965-x.
H. Prabhu, A. Sane, R. Dhadwal, N. R. Parlikkad, and J. K. Valadi, “Interpretation of Drop Size Predictions from a Random Forest Model Using Local Interpretable Model-Agnostic Explanations (LIME) in a Rotating Disc Contactor,” Ind. Eng. Chem. Res., 2023, doi: 10.1021/acs.iecr.3c00808.
R. Guidotti, “Counterfactual explanations and how to find them: literature review and benchmarking,” Data Min. Knowl. Discov., vol. 38, no. 5, pp. 2770–2824, Sep. 2024, doi: 10.1007/s10618-022-00831-6.
F. Cheng, Y. Ming, and H. Qu, “DECE: Decision Explorer with Counterfactual Explanations for Machine Learning Models,” IEEE Trans. Vis. Comput. Graph., vol. 27, no. 2, pp. 1438–1447, 2021, doi: 10.1109/TVCG.2020.3030342.
J. Höllig, A. F. Markus, J. de Slegte, and P. Bagave, Semantic Meaningfulness: Evaluating Counterfactual Approaches for Real-World Plausibility and Feasibility, vol. 1902 CCIS. 2023. doi: 10.1007/978-3-031-44067-0_32.
P. Rakesh, J. R. Shruti, I. Thippeswamy, B. L. Nithya, and V. Dheeraj, “A Surrogate Approach to Explainable AI for Predictive Maintenance: Techniques and Applications,” in 5th International Conference on Circuits, Control, Communication and Computing, I4C 2024, 2024, pp. 160 – 165. doi: 10.1109/I4C62240.2024.10748524.
A. L. Alfeo and M. G. C. A. Cimino, “Counterfactual-Based Feature Importance for Explainable Regression of Manufacturing Production Quality Measure,” in International Conference on Pattern Recognition Applications and Methods, 2024, pp. 48–56. doi: 10.5220/0012369600003654.
L. Celar and R. M. J. Byrne, “How people reason with counterfactual and causal explanations for Artificial Intelligence decisions in familiar and unfamiliar domains,” Mem. Cognit., vol. 51, no. 7, pp. 1481–1496, 2023, doi: 10.3758/s13421-023-01407-5.
P. M. Vannostrand, D. M. Hofmann, L. Ma, B. Genin, R. Huang, and E. A. Rundensteiner, “Counterfactual Explanation Analytics: Empowering Lay Users to Take Action Against Consequential Automated Decisions,” Proceedings of the VLDB Endowment, vol. 17, no. 12, pp. 4349–4352, 2024, doi: 10.14778/3685800.3685872.
Z. Wang, I. Miliou, I. Samsten, and P. Papapetrou, “Counterfactual Explanations for Time Series Forecasting,” in Proceedings - IEEE International Conference on Data Mining, ICDM, 2023, pp. 1391–1396. doi: 10.1109/ICDM58522.2023.00180.
G. Zuin and A. Veloso, “Navigating Time’s Possibilities: Plausible Counterfactual Explanations for Multivariate Time-Series Forecast through Genetic Algorithms,” in 2024 IEEE 23rd International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom), IEEE, Dec. 2024, pp. 2575–2582. doi: 10.1109/TrustCom63139.2024.00359.
D. You et al., “Counterfactual explanation generation with minimal feature boundary,” Inf. Sci. (N Y)., vol. 625, pp. 342 – 366, 2023, doi: 10.1016/j.ins.2023.01.012.
J. Liu, X. Wu, S. Liu, and S. Gong, “Model-agnostic counterfactual explanation: A feature weights-based comprehensive causal multi-objective counterfactual framework,” Expert Syst. Appl., vol. 266, Mar. 2025, doi: 10.1016/j.eswa.2024.126063.
Y. Yuan, K. McAreavey, S. Li, and W. Liu, “Multi-Granular Evaluation of Diverse Counterfactual Explanations,” in International Conference on Agents and Artificial Intelligence, Science and Technology Publications, Lda, 2024, pp. 186–197. doi: 10.5220/0012349900003636.
G. Dudek, “Short-term load forecasting using random forests,” Advances in Intelligent Systems and Computing, vol. 323, pp. 821 – 828, 2015, doi: 10.1007/978-3-319-11310-4_71.
X. Wu, J. He, P. Zhang, and J. Hu, “Power system short-term load forecasting based on improved random forest with grey relation projection,” Dianli Xitong Zidonghua/Automation of Electric Power Systems, vol. 39, no. 12, pp. 50 – 55, 2015, doi: 10.7500/AEPS20140916005.
A. M. Ernesto, “Short-term electricity load forecasting (Panama case study),” Mendeley Data, no. V1, 2021, doi: 10.17632/byx7sztj59.1.
A. Soriano-Vargas et al., “A visual analytics approach to anomaly detection in hydrocarbon reservoir time series data,” J. Pet. Sci. Eng., vol. 206, 2021, doi: 10.1016/j.petrol.2021.108988.
S. M. Ghazali, N. Shaadan, and Z. Idrus, “Missing data exploration in air quality data set using r-package data visualisation tools,” Bulletin of Electrical Engineering and Informatics, vol. 9, no. 2, pp. 755 – 763, 2020, doi: 10.11591/eei.v9i2.2088.
N. Bui, D. Nguyen, and V. A. Nguyen, “Counterfactual Plans Under Distributional Ambiguity,” in ICLR 2022 - 10th International Conference on Learning Representations, 2022. doi: 10.48550/arXiv.2201.12487.
M. Virgolin and S. Fracaros, “On the robustness of sparse counterfactual explanations to adverse perturbations,” Artif. Intell., vol. 316, 2023, doi: 10.1016/j.artint.2022.103840.