Interpretable Machine Learning for Multi-Energy Supply Station Revenue Forecasting: A SHAP-Driven Framework to Accelerate Urban Carbon Neutrality
Abstract
:1. Introduction
1.1. Background
1.2. Related Works
1.3. Contributions of This Work
- (1)
- A data-driven framework for sustainable revenue forecasting is proposed. It integrates transaction data from multiple energy sources, including petroleum, natural gas, electricity, and hydrogen. Using four machine learning algorithms—DTR, RF, SVR, and MLP—the framework predicts hourly total transaction value with high accuracy (R2 = 0.98), providing real-time decision support for resource allocation.
- (2)
- The SHAP algorithm is applied to identify key drivers of revenue fluctuations (such as consumption volume and transaction frequency) and quantify their impacts. This provides strategies for reducing energy waste and carbon emissions while enhancing model interpretability.
- (3)
- Policy and Practical Implications: Our findings offer scalable solutions for urban planners and energy providers to design efficient MESS networks, directly supporting the implementation of carbon neutrality policies in smart cities.
1.4. Organization
2. Methodology
2.1. Data Preprocessing and Feature Engineering
2.1.1. Decision Tree Regression (DTR)
2.1.2. Random Forest (RF)
2.1.3. Support Vector Regression (SVR)
2.1.4. Multilayer Perceptron (MLP)
2.2. Evaluating Index
- (1)
- Mean Squared Error (MSE)
- (2)
- Root Mean Squared Error (RMSE)
- (3)
- Mean Absolute Error (MAE)
- (4)
- Mean Absolute Percentage Error (MAPE)
- (5)
- R-squared (R2)
- (6)
- Explanatory variance (EV)
2.3. SHAP Implementation
3. Method Application
3.1. Data Description
3.2. Correlation Analysis
3.3. Model Parameter Settings
3.4. Model Performance Analysis
- (1)
- The SVR model has the highest MAE value, indicating that its average absolute prediction error is the largest; the RF and MLP models have relatively lower MAE values, suggesting that these two models have more minor average absolute prediction errors, i.e., they are more accurate in predicting the hourly GTV.
- (2)
- The SVR model’s MSE value is significantly higher than that of other models, which indicates that its average squared prediction errors are more considerable, and there may be significant prediction bias or outliers; the RF model has the lowest MSE value, indicating that its average squared prediction errors are the smallest.
- (3)
- The SVR model’s RMSE value is the highest, consistent with the MSE analysis, indicating that its prediction error is larger; the RF model’s RMSE value is the lowest, indicating that its root mean square prediction error is the smallest.
- (4)
- The SVR model has the highest MAPE value, which means that its prediction error as a percentage of the actual value is the largest; the DTR model has the lowest MAPE value, indicating that its prediction error as a percentage of the actual value is the smallest.
- (5)
- When the R2 values of the DTR and RF models are close, these two models can explain the variability in the data well. As shown in Figure 5, the R2 values of the DTR and RF models are close to 1, which indicates that these two models have high accuracy in predicting the GTV and can capture most of the variability in the data; in contrast, the SVR model has the lowest R2 value, indicating that its ability to explain data variability is relatively weak, and its prediction accuracy is relatively poor.
- (6)
- The EV values of the DTR and RF models are close to 1, consistent with the analysis of R2, indicating that these two models have strong explanatory power; the SVR model has the lowest EV value, suggesting that its explanatory power is relatively weak.
- (1)
- The DTR model has the highest MAE value, indicating the largest average absolute prediction error. In contrast, the RF and MLP models have relatively lower MAE values, suggesting that these two models have smaller average absolute errors and thus provide more accurate predictions of the total transaction amount per hour.
- (2)
- The MSE value of the DTR model is significantly higher than that of the other models, implying a larger average of squared prediction errors. This may indicate substantial prediction bias or the presence of outliers. The RF model, however, has the lowest MSE value, meaning it has the smallest average of squared prediction errors.
- (3)
- The RMSE value of the DTR model is the highest, consistent with the MSE analysis, indicating larger prediction errors. The RF model has the lowest RMSE value, showing the smallest root mean square error.
- (4)
- The DTR model has the highest MAPE value, meaning its prediction errors as a percentage of actual values are the largest. The RF model has the lowest MAPE value, indicating the smallest percentage errors relative to actual values.
- (5)
- When the R2 values of the RF and MLP models are close, it suggests that both models can effectively explain the variability in the data. As shown in Figure 7, the R2 values of the RF and MLP models are close to 1, indicating high accuracy in predicting total transaction amounts and the ability to capture most of the data variability. Conversely, the DTR model has the lowest R2 value, suggesting weaker explanatory power and lower prediction accuracy.
- (6)
- The EV values of the RF and MLP models are close to 1, consistent with the R2 analysis, indicating strong explanatory power. The DTR model has the lowest EV value, reflecting weaker explanatory ability.
3.5. Interpretability Analysis
- (1)
- Global Interpretation Based on the SHAP Algorithm
- (2)
- Local Explanation Based on the SHAP Algorithm
- (3)
- Comparison of Feature Importance between SHAP Algorithm and RF Algorithm
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Nomenclature
BP | Back Propagation |
CNN | Convolutional Neural Networks |
DF | Deep Forest |
DT | Decision Tree |
DTR | Decision Tree Regression |
DWT | Discrete Wavelet Transformation |
EV | Explanatory Variance |
GBDT | Gradient Boosting Decision Tree |
GRA | Grey Relational Analysis |
GTV | Gross Transaction Value |
GY | Grey Models |
KNN | K-Nearest Neighbor |
LightGBM | Light Gradient Boosting Machine |
LR | Linear Regression |
LSTM | Long Short-Term Memory |
MAE | Mean Absolute Error |
MAPE | Mean Absolute Percentage Error |
ML | Machine Learning |
MLP | Multilayer Perceptron |
MSE | Mean Squared Error |
R2 | R-squared |
RF | Random Forest |
RMSE | Root Mean Squared Error |
RNN | Recurrent Neural Network |
SHAP | Shapley Additive Explanations |
SVM | Support Vector Machine |
SVR | Support Vector Regression |
XGBoost | eXtreme Gradient Boosting |
References
- Cen, X.; Chen, Z.; Chen, H.; Ding, C.; Ding, B.; Li, F.; Lou, F.; Zhu, Z.; Zhang, H.; Hong, B. User repurchase behavior prediction for integrated energy supply stations based on the user profiling method. Energy 2024, 286, 129625. [Google Scholar] [CrossRef]
- Han, Y.; Meng, J.; Luo, Z. Multi-agent deep reinforcement learning for blockchain-based energy trading in decentralized electric vehicle charger-sharing networks. Electronics 2024, 13, 4235. [Google Scholar] [CrossRef]
- Yiğit, Y.; Karabatak, M. A deep reinforcement learning-based speed optimization system to reduce fuel consumption and emissions for smart cities. Appl. Sci. 2025, 15, 1545. [Google Scholar] [CrossRef]
- Zeng, B.; Wang, W.; Zhang, W.; Wang, Y.; Tang, C.; Wang, J. Optimal configuration planning of vehicle sharing station-based electro-hydrogen micro-energy systems for transportation decarbonization. J. Clean. Prod. 2023, 387, 135906. [Google Scholar] [CrossRef]
- Jia, J.; Li, H.; Wu, D.; Guo, J.; Jiang, L.; Fan, Z. Multi-objective optimization study of regional integrated energy systems coupled with renewable energy, energy storage, and inter-station energy sharing. Renew. Energy 2024, 225, 120328. [Google Scholar] [CrossRef]
- Petroșanu, D.M.; Pîrjan, A.; Căruţaşu, G.; Tăbușcă, A.; Zirra, D.L.; Perju-Mitran, A. E-commerce sales revenues forecasting by means of dynamically designing, developing and validating a directed acyclic graph (DAG) network for deep learning. Electronics 2022, 11, 2940. [Google Scholar] [CrossRef]
- Bilal, G.A.; Al-Saadi, M.K.; Al-Sultany, G.A.; Al-Maliki, W.A.K. Optimal operation of CCHP smart distribution grid with integration of renewable energy. Appl. Sci. 2025, 15, 1407. [Google Scholar] [CrossRef]
- Shahzad, U. Environmental taxes, energy consumption, and environmental quality: Theoretical survey with policy implications. Environ. Sci. Pollut. Res. Int. 2020, 27, 24848–24862. [Google Scholar] [CrossRef]
- Yasmeen, R.; Zhang, X.; Tao, R.; Shah, W.U.H. The impact of green technology, environmental tax and natural resources on energy efficiency and productivity: Perspective of OECD Rule of Law. Energy Rep. 2023, 9, 1308–1319. [Google Scholar] [CrossRef]
- Yu, H.; Chen, W.; Wang, X.; Delina, L.; Cheng, Z.; Zhang, L. The impact of the energy conservation law on enterprise energy efficiency: Quasi-experimental evidence from Chinese firms. Energy Econ. 2025, 143, 108252. [Google Scholar] [CrossRef]
- Guo, J.; Hao, H.; Wang, M.; Liu, Z. An empirical study on consumers’ willingness to buy agricultural products online and its influencing factors. J. Clean. Prod. 2022, 336, 130403. [Google Scholar] [CrossRef]
- Agboola, E.; Chowdhury, R.; Yang, B. Oil price fluctuations and their impact on oil-exporting emerging economies. Econ. Model. 2024, 132, 106665. [Google Scholar] [CrossRef]
- Semenza, J.C.; Herbst, S.; Rechenburg, A.; Suk, J.E.; Höser, C.; Schreiber, C.; Kistemann, T. Climate change impact assessment of food-and waterborne diseases. Crit. Rev. Environ. Sci. Technol. 2012, 42, 857–890. [Google Scholar] [CrossRef] [PubMed]
- Yang, Q.; Huang, D.X. Gasoline sales prediction and sample data design. Comput. Eng. Appl. 2007, 43, 210–213,219. [Google Scholar] [CrossRef]
- Hao, Q. Fueling rule analysis and fuel charge prediction of jet fuel in airport. Oil Gas Storage Transp. 2016, 35, 315–320. [Google Scholar] [CrossRef]
- Zhang, C.; Qiu, T. Gas station sales forecast based on decision tree integration model. Comput. Appl. Chem. 2019, 36, 615–619. [Google Scholar] [CrossRef]
- Deng, T.; Zhao, Y.; Wang, S.; Yu, H. Sales forecasting based on LightGBM. In Proceedings of the 2021 IEEE International Conference on Consumer Electronics and Computer Engineering (ICCECE), Guangzhou, China, 15–17 January 2021; pp. 383–386. [Google Scholar] [CrossRef]
- Cui, B.; Ye, Z.; Zhao, H.; Renqing, Z.; Meng, L.; Yang, Y. Used car price prediction based on the iterative framework of XGBoost+ LightGBM. Electronics 2022, 11, 2932. [Google Scholar] [CrossRef]
- Kumar, A.; Kabra, G.; Mussada, E.K.; Dash, M.K.; Rana, P.S. Combined artificial bee colony algorithm and machine learning techniques for prediction of online consumer repurchase intention. Neural Comput. Appl. 2019, 31, 877–890. [Google Scholar] [CrossRef]
- Wu, J.; Shi, L.; Yang, L.; Niu, X.; Li, Y.; Cui, X.; Tsai, S.B.; Zhang, Y. User value identification based on improved RFM model and K-means++ algorithm for complex data analysis. Wirel. Commun. Mob. Comput. 2021, 2021, 9982484. [Google Scholar] [CrossRef]
- Chen, T.; Yin, H.; Chen, H.; Wang, H.; Zhou, X.; Li, X. Online sales prediction via trend alignment-based multitask recurrent neural networks. Knowl. Inf. Syst. 2020, 62, 2139–2167. [Google Scholar] [CrossRef]
- Zhang, W.; Wang, M. An improved deep forest model for prediction of e-commerce consumers’ repurchase behavior. PLoS ONE 2021, 16, e0255906. [Google Scholar] [CrossRef]
- Liu, B.; Song, C.; Liang, X.; Lai, M.; Yu, Z.; Ji, J. Regional differences in China’s electric vehicle sales forecasting: Under supply-demand policy scenarios. Energy Policy 2023, 177, 113554. [Google Scholar] [CrossRef]
- Li, W.; Becker, D.M. Day-ahead electricity price prediction applying hybrid models of LSTM-based deep learning methods and feature selection algorithms under consideration of market coupling. Energy 2021, 237, 121543. [Google Scholar] [CrossRef]
- Costa, V.G.; Pedreira, C.E. Recent advances in decision trees: An updated survey. Artif. Intell. Rev. 2023, 56, 4765–4800. [Google Scholar] [CrossRef]
- Kim, C.; Kim, S. A decision tree-based pattern classification and regression for a mobility support scheme in industrial wireless sensor networks. Appl. Sci. 2025, 15, 1408. [Google Scholar] [CrossRef]
- Hynes, N.R.J.; Sankaranarayanan, R.; Sujana, J.A.J. A decision tree approach for energy efficient friction riveting of polymer/metal multi-material lightweight structures. J. Clean. Prod. 2021, 292, 125317. [Google Scholar] [CrossRef]
- Hong, B.Y.; Liu, S.N.; Li, X.P.; Fan, D.; Ji, S.P.; Chen, S.H.; Li, C.C.; Gong, J. A liquid loading prediction method of gas pipeline based on machine learning. Pet. Sci. 2022, 19, 3004–3015. [Google Scholar] [CrossRef]
- Ma, Y.; He, L.; Zheng, J. STL-DCSInformer-ETS: A hybrid model for medium- and long-term sales forecasting of fast-moving consumer goods. Appl. Sci. 2025, 15, 1516. [Google Scholar] [CrossRef]
- Wang, Z.; Wu, F.; Hao, N.; Wang, T.; Cao, N.; Wang, X. The combined machine learning model SMOTER-GA-RF for methane yield prediction during anaerobic digestion of straw lignocellulose based on random forest regression. J. Clean. Prod. 2024, 466, 142909. [Google Scholar] [CrossRef]
- Pham, Q.B.; Tran, D.A.; Ha, N.T.; Islam, A.R.M.T.; Salam, R. Random forest and nature-inspired algorithms for mapping groundwater nitrate concentration in a coastal multi-layer aquifer system. J. Clean. Prod. 2022, 343, 130900. [Google Scholar] [CrossRef]
- Cai, W.; Wen, X.; Li, C.; Shao, J.; Xu, J. Predicting the energy consumption in buildings using the optimized support vector regression model. Energy 2023, 273, 127188. [Google Scholar] [CrossRef]
- Btoush, E.; Zhou, X.; Gururajan, R.; Chan, K.C.; Alsodi, O. Achieving excellence in cyber fraud detection: A hybrid ML+DL ensemble approach for credit cards. Appl. Sci. 2025, 15, 1081. [Google Scholar] [CrossRef]
- Li, Q.; Li, D.; Zhao, K.; Wang, L.; Wang, K. State of health estimation of lithium-ion battery based on improved ant lion optimization and support vector regression. J. Energy Storage 2022, 50, 104215. [Google Scholar] [CrossRef]
- Amiri, M.K.; Zaferani, S.P.G.; Emami, M.R.S.; Zahmatkesh, S.; Pourhanasa, R.; Namaghi, S.S.; Klemeš, J.J.; Bokhari, A.; Hajiaghaei-Keshteli, M. Multi-objective optimization of thermophysical properties GO powders-DW/EG Nf by RSM, NSGA-II, ANN, MLP and ML. Energy 2023, 280, 128176. [Google Scholar] [CrossRef]
- Chen, D.; Chui, C.K.; Lee, P.S. Adaptive physically consistent neural networks for data center thermal dynamics modeling. Appl. Energy 2025, 377, 124637. [Google Scholar] [CrossRef]
- Qi, X.; Wang, S.; Fang, C.; Jia, J.; Lin, L.; Yuan, T. Machine learning and SHAP value interpretation for predicting comorbidity of cardiovascular disease and cancer with dietary antioxidants. Redox Biol. 2024, 79, 103470. [Google Scholar] [CrossRef]
- Luo, Z.; Qi, X.; Sun, C.; Dong, Q.; Gu, J.; Gao, X. Investigation of influential variations among variables in daylighting glare metrics using machine learning and SHAP. Build. Environ. 2024, 254, 111394. [Google Scholar] [CrossRef]
- Yuan, Y.; Guo, W.; Tang, S.; Zhang, J. Effects of patterns of urban green-blue landscape on carbon sequestration using XGBoost-SHAP model. J. Clean. Prod. 2024, 476, 143640. [Google Scholar] [CrossRef]
- Zhao, J.; Zhang, Q.; Tian, L. Market revenue prediction and error analysis of products based on fuzzy logic and artificial intelligence algorithms. J. Ambient. Intell. Smart Environ. 2020, 11, 4011–4018. [Google Scholar] [CrossRef]
- Weng, C.H. Revenue prediction by mining frequent itemsets with customer analysis. Eng. Appl. Artif. Intell. 2017, 63, 85–97. [Google Scholar] [CrossRef]
- Golderzahi, V.; Pao, H.K.K. Revenue forecasting in smart retail based on customer clustering analysis. Internet Things 2024, 27, 101286. [Google Scholar] [CrossRef]
- Asgarkhani, N.; Kazemi, F.; Jankowski, R. Machine learning-based prediction of residual drift and seismic risk assessment of steel moment-resisting frames considering soil-structure interaction. Comput. Struct. 2023, 289, 107181. [Google Scholar] [CrossRef]
Reference | Feature Selection | Optimization Algorithm | ML Techniques | Interpretability Analysis | Multi-Energy Analysis |
---|---|---|---|---|---|
Yang et al. [14] | √ | × | BP, LR | × | × |
Hao. [15] | √ | × | LR, GM, BP | × | × |
Zhang et al. [16] | √ | × | DT, RF, GBDT | × | × |
Deng et al. [17] | √ | × | LightGBM, LR, SVR | × | × |
Cui et al. [18] | √ | × | LightGBM XGBoost | × | × |
Kumar et al. [19] | √ | √ | DT, AdaBoost, RF, SVM | × | × |
Wu et al. [20] | √ | √ | RFM, K-means | × | × |
Chen et al. [21] | √ | × | RNN, LSTM, TADA | × | × |
Zhang and Wang [22] | √ | √ | DF, KNN, LR, RF, CNN | × | × |
Liu et al. [23] | × | √ | GRA, DWT, LSTM, K-means | √ | × |
Li et al. [24] | √ | √ | LSTM, SHAP RNN, CNN | √ | × |
This Paper | √ | √ | DT, RF, SVR, MLP, SHAP | √ | √ |
Feature | Unit | Meaning | Continuity |
---|---|---|---|
Hourly Consumption Time | Hours | Divides a day into 24 h | Continuous |
Consumption Volume | Yuan | Total consumption within an hour | Discrete |
Number of Consumption Occasions | Times | Number of consumption behaviors occurring within an hour | Discrete |
Personal Consumption Vehicle Data Volume | Vehicles | Number of vehicles for personal consumption within an hour | Discrete |
Non-Personal Consumption Vehicle Data Volume | Vehicles | Number of vehicles for non-personal consumption within an hour | Discrete |
Whether Holiday | 0 or 1 | 1 indicates a holiday, 0 indicates not a holiday | Discrete |
Whether Weekend | 0 or 1 | 1 indicates a weekend, 0 indicates not a weekend | Discrete |
Season | 0–3 | Season divided according to the date: 0 represents spring, 1 represents summer, 2 represents autumn, and 3 represents winter | Discrete |
Total Transaction Amount | Yuan | Total amount of all transactions within an hour | Discrete |
Model | Hyper-Parameter | Search Space | Optimal Hyper-Parameter |
---|---|---|---|
RF | n_estimators | 1~200 | 181 |
max_depth | 1~21 | 13 | |
max_features | [1,5,10,15,20, ‘auto’, ‘sqrt’, ‘log2’, None] | sqrt | |
min_samples_leaf | 1~20 | 1 | |
min_samples_split | 1~20 | 2 | |
SVR | kernel | [‘linear’, ‘rbf’, ‘poly’, ‘sigmoid’] | poly |
C | [0.01,0.1,0.2,0.5,0.8,1,5,10,25,50,75,100,125] | 100 | |
gamma | [0.01,0.05,0.1,0.2,0.5,0.8,1] | 1 | |
epsilon | [0.01,0.05,0.1,0.2,0.5,0.8,1] | 0.01 | |
DT | max_depth | 1~20 | 14 |
max_features | [“auto”, “sqrt”, “log2”, None, 5] | sqrt | |
min_samples_leaf | 1~20 | 6 | |
min_samples_split | 2~20 | 1 | |
MLP | alpha | [0.01, 0.05, 0.1] | 0.01 |
hidden_layer_sizes | 1~50 | 104 | |
max_iter | 1~1001 | 101 | |
activation | [‘relu’, ‘tanh’, ‘logistic’] | Relu | |
solver | [‘lbfgs’, ‘sgd’, ‘adam’] | lbfgs |
Rank | Feature Importance | |||
---|---|---|---|---|
The Built-in Interpretability Features of the RF Algorithm | SHAP | |||
Feature | Importance Score | Feature | Importance Score | |
1 | Consumption Volume | 0.468331 | Consumption Volume | 0.522293 |
2 | Number of Consumption Occasions | 0.199677 | Number of Consumption Occasions | 0.213521 |
3 | Personal Consumption Vehicle Data Volume | 0.186803 | Personal Consumption Vehicle Data Volume | 0.210576 |
4 | Hourly Consumption Time | 0.022131 | Hourly Consumption Time | 0.035886 |
5 | Non-Personal Consumption Vehicle Data Volume | 0.012713 | Non-Personal Consumption Vehicle Data Volume | 0.008716 |
6 | Whether Weekend | 0.006382 | Whether Weekend | 0.003901 |
7 | Season | 0.005971 | Season | 0.003147 |
8 | Whether Holiday | 0.003965 | Whether Holiday | 0.001961 |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhao, Z.; Wang, M.; Wei, J.; Cen, X.; Du, S.; Wu, Z.; Liu, H.; Wang, W. Interpretable Machine Learning for Multi-Energy Supply Station Revenue Forecasting: A SHAP-Driven Framework to Accelerate Urban Carbon Neutrality. Energies 2025, 18, 1624. https://doi.org/10.3390/en18071624
Zhao Z, Wang M, Wei J, Cen X, Du S, Wu Z, Liu H, Wang W. Interpretable Machine Learning for Multi-Energy Supply Station Revenue Forecasting: A SHAP-Driven Framework to Accelerate Urban Carbon Neutrality. Energies. 2025; 18(7):1624. https://doi.org/10.3390/en18071624
Chicago/Turabian StyleZhao, Zhihui, Minjuan Wang, Jin Wei, Xiao Cen, Shengnan Du, Ziwen Wu, Huanying Liu, and Weiqiang Wang. 2025. "Interpretable Machine Learning for Multi-Energy Supply Station Revenue Forecasting: A SHAP-Driven Framework to Accelerate Urban Carbon Neutrality" Energies 18, no. 7: 1624. https://doi.org/10.3390/en18071624
APA StyleZhao, Z., Wang, M., Wei, J., Cen, X., Du, S., Wu, Z., Liu, H., & Wang, W. (2025). Interpretable Machine Learning for Multi-Energy Supply Station Revenue Forecasting: A SHAP-Driven Framework to Accelerate Urban Carbon Neutrality. Energies, 18(7), 1624. https://doi.org/10.3390/en18071624