An Integrated Stacking Ensemble Model for Natural Gas Purchase Prediction Incorporating Multiple Features
<p>Data visualization.</p> "> Figure 2
<p>Correlation matrix of regional features, basic features, and gas purchase volume.</p> "> Figure 3
<p>Correlation matrix of usage types, basic features, and gas purchase volume.</p> "> Figure 4
<p>Stacking ensemble model architecture.</p> "> Figure 5
<p>Comparison of actual and predicted gas purchase volumes using the INF model with different feature combinations. (<b>a</b>) INF; (<b>b</b>) INF-RB; (<b>c</b>) INF-UB; (<b>d</b>) INF-RB-UB.</p> "> Figure 6
<p>Comparison of actual and predicted gas purchase volumes using the MLR model with different feature combinations. (<b>a</b>) MLR; (<b>b</b>) MLR-RB; (<b>c</b>) MLR-UB; (<b>d</b>) MLR-RB-UB.</p> "> Figure 7
<p>Comparison of actual and predicted gas purchase volumes using the SVR model with different feature combinations. (<b>a</b>) SVR; (<b>b</b>) SVR-RB; (<b>c</b>) SVR-UB; and (<b>d</b>) SVR-RB-UB.</p> "> Figure 8
<p>Comparison of actual and predicted gas purchase volumes using stacking.</p> ">
Abstract
:1. Introduction
- Pioneering application of stacking ensemble: This study marks the first application of the stacking ensemble method to natural gas procurement forecasting. By integrating the strengths of 12 base models derived from Informer, MLR, and SVR backbone models, this approach significantly improved the value by at least four percentage points.
- Fine-grained feature integration: Segmenting natural gas demand by regional and usage characteristics enhanced the value of the three backbone models by approximately 1–15 percentage points, providing more accurate inputs for the stacking ensemble model.
- Enhanced seasonality modeling: Adding weather factors (e.g., maximum and minimum temperatures) significantly improved the model’s response to seasonal changes and medium-term demand fluctuations, resulting in an improvement of approximately 5–10 percentage points.
2. Related Work
2.1. Models Related to Natural Gas Prediction
2.2. Ensemble Methods
2.3. Feature Engineering
3. Materials and Methods
3.1. Data
3.2. Backbone Models and Construction of Basic Natural Gas Purchase Forecasting Models
3.2.1. Informer and Its Four Base Model Constructions
- 1.
- ProbSparse attention: By focusing on the most critical parts of the sequence, the quadratic complexity of traditional self-attention is reduced to logarithmic complexity. It is achieved by selecting the top U queries based on their impact, significantly speeding up the processing.
- 2.
- Distilling operation: The distilling operation reduces the sequence length by halving it at each layer while retaining key information, thereby decreasing the dimensionality of the sequence.
- 1.
- INF: This model utilizes only basic features for prediction. The model is formulated as follows:
- 2.
- INF-RB: Based on the basic features, regional features (natural gas sales volumes in different regions) are added. The model is formulated as follows:
- 3.
- INF-UB: Based on the basic features, usage features (such as commercial, industrial, residential, etc.) are added. The model is formulated as follows:
- 4.
- INF-RB-UB: Combining basic features, regional features, and usage features, this model comprehensively considers all features for prediction. The model is formulated as follows:
3.2.2. MLR and Its Four Base Model Constructions
- 1.
- MLR:
- 2.
- MLR-RB:
- 3.
- MLR-UB:
- 4.
- MLR-RB-UB:
3.2.3. SVR and Its Four Base Model Constructions
- 1.
- SVR:
- 2.
- SVR-RB:
- 3.
- SVR-UB:
- 4.
- SVR-UB-RB:
3.3. Stacking Ensemble
- 1.
- Data preprocessing: Split the original dataset into the training set and test set ;
- 2.
- Base learner training: Train each base learner on the training set to generate predictions . Simultaneously, perform predictions on the test set to generate ;
- 3.
- Secondary training set generation: Combine the predictions of the base learners on the training set to form a new feature matrix . Similarly, combine the predictions on the test set to form ;
- 4.
- Meta-learner training: Train the meta-learner using the secondary training set ;
- 5.
- Final prediction: Use the trained meta-learner to make predictions on the secondary test set feature matrix , generating the final prediction .
4. Experimental Results
4.1. Evaluation Metrics
4.2. Experimental Results Analysis
4.2.1. Informer Experimental Results
4.2.2. MLR Experimental Results
4.2.3. SVR Experimental Results
4.2.4. Stacking Experimental Results
4.3. Engineering Application
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Di Bella, G.; Flanagan, M.; Foda, K.; Maslova, S.; Pienkowski, A.; Stuermer, M.; Toscani, F. Natural gas in europe: The potential impact of disruptions to supply. Energy Econ. 2024, 138, 107777. [Google Scholar] [CrossRef]
- Shahbaz, M.; Lean, H.H.; Farooq, A. Natural gas consumption and economic growth in pakistan. Renew. Sustain. Energy Rev. 2013, 18, 87–94. [Google Scholar] [CrossRef]
- Lim, B.; Zohren, S. Time-series forecasting with deep learning: A survey. Philos. Trans. R. Soc. 2021, 379, 20200209. [Google Scholar] [CrossRef]
- Schaffer, A.L.; Dobbins, T.A.; Pearson, S.-A. Interrupted time series analysis using autoregressive integrated moving average (arima) models: A guide for evaluating large-scale health interventions. BMC Med. Res. Methodol. 2021, 21, 58. [Google Scholar] [CrossRef]
- Khotanzad, A.; Elragal, H. Natural gas load forecasting with combination of adaptive neural networks. In Proceedings of the IJCNN’99, International Joint Conference on Neural Networks, Proceedings (Cat. No. 99CH36339), Washington, DC, USA, 10–16 July 1999; Volume 6, pp. 4069–4072. [Google Scholar]
- Szoplik, J. Forecasting of natural gas consumption with artificial neural networks. Energy 2015, 85, 208–220. [Google Scholar] [CrossRef]
- Galván, E.; Mooney, P. Neuroevolution in deep neural networks: Current trends and future challenges. IEEE Trans. Artif. 2021, 2, 476–493. [Google Scholar] [CrossRef]
- Azadeh, A.; Asadzadeh, S.; Mirseraji, G.; Saberi, M. An emotional learning-neuro-fuzzy inference approach for optimum training and forecasting of gas consumption estimation models with cognitive data. Technol. Forecast. Soc. Change 2015, 91, 47–63. [Google Scholar] [CrossRef]
- Ding, J.; Zhao, Y.; Jin, J. Forecasting natural gas consumption with multiple seasonal patterns. Appl. Energy 2023, 337, 120911. [Google Scholar] [CrossRef]
- Khan, M.A.; Ahmad, U. Energy demand in pakistan: A disaggregate analysis. Pak. Dev. Rev. 2008, 47, 437–455. [Google Scholar]
- Sánchez-Úbeda, E.F.; Berzosa, A. Modeling and forecasting industrial end-use natural gas consumption. Energy Econ. 2007, 29, 710–742. [Google Scholar] [CrossRef]
- Nasr, G.; Badr, E.; Joun, C. Backpropagation neural networks for modeling gasoline consumption. Energy Convers. Manag. 2003, 44, 893–905. [Google Scholar] [CrossRef]
- Khan, M.A. Modelling and forecasting the demand for natural gas in pakistan. Renew. Sustain. Energy Rev. 2015, 49, 1145–1159. [Google Scholar] [CrossRef]
- Zhao, H.; Zhou, Z.; Zhang, P. Forecasting of the short-term electricity load based on woa-bilstm. Int. J. Pattern Recognition Artif. Intell. 2023, 37, 2359018. [Google Scholar] [CrossRef]
- Zhang, Y.; Liu, J.; Shen, W. A review of ensemble learning algorithms used in remote sensing applications. Appl. Sci. 2022, 12, 8654. [Google Scholar] [CrossRef]
- Bentéjac, C.; Csörgő, A.; Martínez-Muñoz, G. A comparative analysis of gradient boosting algorithms. Artif. Rev. 2021, 54, 1937–1967. [Google Scholar] [CrossRef]
- Svoboda, R.; Kotik, V.; Platos, J. Short-term natural gas consumption forecasting from long-term data collection. Energy 2021, 218, 119430. [Google Scholar] [CrossRef]
- Altman, N.; Krzywinski, M. Ensemble methods: Bagging and random forests. Nat. Methods 2017, 14, 933–935. [Google Scholar] [CrossRef]
- Ngo, G.; Beard, R.; Chandra, R. Evolutionary bagging for ensemble learning. Neurocomputing 2022, 510, 1–14. [Google Scholar] [CrossRef]
- Meira, E.; Oliveira, F.L.C.; de Menezes, L.M. Forecasting natural gas consumption using bagging and modified regularization techniques. Energy Econ. 2022, 106, 105760. [Google Scholar] [CrossRef]
- Divina, F.; Gilson, A.; Goméz-Vela, F.; Torres, M.G.; Torres, J.F. Stacking ensemble learning for short-term electricity consumption forecasting. Energies 2018, 11, 949. [Google Scholar] [CrossRef]
- Zhou, Z.-H. Ensemble methods. Combining Pattern Classifiers; Wiley: Hoboken, NJ, USA, 2014; pp. 186–229. [Google Scholar]
- Zhou, Z.-H. Ensemble Methods: Foundations and Algorithms; CRC Press: Boca Raton, FL, USA, 2012. [Google Scholar]
- Papageorgiou, K.I.; Poczeta, K.; Papageorgiou, E.; Gerogiannis, V.C.; Stamoulis, G. Exploring an ensemble of methods that combines fuzzy cognitive maps and neural networks in solving the time series prediction problem of gas consumption in greece. Algorithms 2019, 12, 235. [Google Scholar] [CrossRef]
- Yang, Z.; Keung, J.; Kabir, M.A.; Yu, X.; Tang, Y.; Zhang, M.; Feng, S. Acomnn: Attention enhanced compound neural network for financial time-series forecasting with cross-regional features. Appl. Soft Comput. 2021, 111, 107649. [Google Scholar] [CrossRef]
- Cheng, L.; Zang, H.; Xu, Y.; Wei, Z.; Sun, G. Probabilistic residential load forecasting based on micrometeorological data and customer consumption pattern. IEEE Trans. Power Syst. 2021, 36, 3762–3775. [Google Scholar] [CrossRef]
- Wang, J.; Zhong, H.; Lai, X.; Xia, Q.; Wang, Y.; Kang, C. Exploring key weather factors from analytical modeling toward improved solar power forecasting. IEEE Trans. Smart Grid 2017, 10, 1417–1427. [Google Scholar] [CrossRef]
- Wadud, Z.; Dey, H.S.; Kabir, M.A.; Khan, S.I. Modeling and forecasting natural gas demand in bangladesh. Energy Policy 2011, 39, 7372–7380. [Google Scholar] [CrossRef]
- Tong, M.; Qin, F.; Dong, J. Natural gas consumption forecasting using an optimized grey bernoulli model: The case of the world’s top three natural gas consumers. Eng. Appl. Artif. Intell. 2023, 122, 106005. [Google Scholar] [CrossRef]
- Omuya, E.O.; Okeyo, G.O.; Kimwele, M.W. Feature selection for classification using principal component analysis and information gain. Expert Syst. Appl. 2021, 174, 114765. [Google Scholar] [CrossRef]
- Zhou, W.; Liu, C.; Yuan, P.; Jiang, L. An undersampling method approaching the ideal classification boundary for imbalance problems. Appl. Sci. 2024, 14, 5421. [Google Scholar] [CrossRef]
- Shao, P.; Zheng, B.; Tang, X.; Chen, C.; Hou, X. Diagnostic method for demagnetization fault of elevator synchronous traction machine based on informer. Int. J. Pattern Recognit. Artif. 2024. [Google Scholar] [CrossRef]
- Shams, S.R.; Jahani, A.; Kalantary, S.; Moeinaddini, M.; Khorasani, N. The evaluation on artificial neural networks (ann) and multiple linear regressions (mlr) models for predicting so2 concentration. Urban Clim. 2021, 37, 100837. [Google Scholar] [CrossRef]
- Sun, Y.; Ding, S.; Zhang, Z.; Jia, W. An improved grid search algorithm to optimize svr for prediction. Soft Comput. 2021, 25, 5633–5644. [Google Scholar] [CrossRef]
- Ma, C.; Zhai, X.; Wang, Z.; Tian, M.; Yu, Q.; Liu, L.; Liu, H.; Wang, H.; Yang, X. State of health prediction for lithium-ion batteries using multiple-view feature fusion and support vector regression ensemble. Int. Mach. Learn. Cybern. 2019, 10, 2269–2282. [Google Scholar] [CrossRef]
- Lee, T.; Kim, J.-H.; Lee, S.-J.; Ryu, S.-K.; Joo, B.-C. Improvement of concrete crack segmentation performance using stacking ensemble learning. Appl. Sci. 2023, 13, 2367. [Google Scholar] [CrossRef]
- Abdellatif, A.; Mubarak, H.; Ahmad, S.; Ahmed, T.; Shafiullah, G.; Hammoudeh, A.; Abdellatef, H.; Rahman, M.; Gheni, H.M. Forecasting photovoltaic power generation with a stacking ensemble model. Sustainability 2022, 14, 11083. [Google Scholar] [CrossRef]
- Erickson, B.J.; Kitamura, F. Magician’s corner: 9. performance metrics for machine learning models. Radiol. Artif. Intell. 2021, 3, e200126. [Google Scholar] [CrossRef]
- Naser, M.; Alavi, A.H. Error metrics and performance fitness indicators for artificial intelligence and machine learning in engineering and sciences. Archit. Struct. Constr. 2023, 3, 499–517. [Google Scholar] [CrossRef]
- Xu, G.; Chen, Y.; Yang, M.; Li, S.; Marma, K.J.S. An outlook analysis on china’s natural gas consumption forecast by 2035: Applying a seasonal forecasting method. Energy 2023, 284, 128602. [Google Scholar] [CrossRef]
Data | Data Content | Data Source |
---|---|---|
2016–2023 Monthly Purchase | Natural gas purchase | Natural Gas LLC, |
Volume Statistics | volume () | Chengdu District |
2016–2023 Monthly Sales Volume | Anjing, Hongguang, Pixian, | Natural Gas LLC, |
Statistics (detailed by region) | Qiaosong, Xipu () | Chengdu District |
2016–2023 Monthly Sales Volume | School, Commercial, Industrial, | Natural Gas LLC, |
Statistics (detailed by usage) | Residential, Collective () | Chengdu District |
2016–2023 Monthly | Max temperature, | Weather Station |
Weather Data | Min temperature (∘C) |
Parameter | Description | Value |
---|---|---|
seq_len | Length of the input sequence | 12 |
label_len | Length of the label sequence for prediction | 6 |
pred_len | Length of the output prediction sequence | 3 |
d_model | Dimension of the input embedding | 512 |
n_heads | Number of attention heads | 8 |
e_layers | Number of encoder layers | 2 |
d_layers | Number of decoder layers | 1 |
d_ff | Dimension of the feed-forward network | 2048 |
dropout | Dropout rate | 0.05 |
activation | Activation function | gelu |
Parameter | Description | Value |
---|---|---|
fit_intercept | Whether to calculate the intercept | True |
normalize | Whether to normalize the input data | False |
copy_X | Whether to copy the input data or overwrite it | True |
Parameter | Description | Value |
---|---|---|
kernel | Type of kernel function | ‘rbf’ (Radial Basis Function) |
C | Regularization parameter | , , , |
gamma | RBF kernel parameter | np.logspace (−2, 2, 5) |
Approach | With Weather Features (, %) | Without Weather Features (, %) |
---|---|---|
INF | 70.46 | 65.15 |
SVR | 67.06 | 57.29 |
MLR | 79.18 | 71.83 |
Approach | MRE | MAE | SMAPE | (%) | RMSE | MAPE (%) |
---|---|---|---|---|---|---|
INF | 0.0851 | 1,094,138 | 0.0881 | 70.46 | 1,593,979 | 8.51 |
INF-RB | 0.0957 | 1,117,435 | 0.1013 | 77.19 | 1,400,524 | 9.57 |
INF-UB | 0.0846 | 1,056,106 | 0.0861 | 76.34 | 1,426,436 | 8.46 |
INF-RB-UB | 0.0789 | 1,000,462 | 0.0811 | 76.77 | 1,413,591 | 7.89 |
Approach | MRE | MAE | SMAPE | (%) | RMSE | MAPE (%) |
---|---|---|---|---|---|---|
MLR | 0.1150 | 1,297,328 | 0.1111 | 67.06 | 1,683,193 | 11.50 |
MLR-RB | 0.0823 | 943,818 | 0.0835 | 82.73 | 1,218,667 | 8.23 |
MLR-UB | 0.0959 | 1,106,853 | 0.0953 | 77.36 | 1,395,385 | 9.59 |
MLR-RB-UB | 0.0823 | 943,053 | 0.0835 | 82.76 | 1,217,738 | 8.23 |
Approach | MRE | MAE | SMAPE | (%) | RMSE | MAPE (%) |
---|---|---|---|---|---|---|
SVR | 0.0976 | 1,074,106 | 0.0957 | 79.18 | 1,338,196 | 9.76 |
SVR-RB | 0.0702 | 817,575 | 0.0718 | 88.60 | 990,176 | 7.02 |
SVR-UB | 0.0978 | 1,121,888 | 0.1018 | 80.30 | 1,301,718 | 9.78 |
SVR-RB-UB | 0.0787 | 895,598 | 0.0799 | 83.31 | 1,198,170 | 7.87 |
Approach | MRE | MAE | SMAPE | (%) | RMSE | MAPE (%) |
---|---|---|---|---|---|---|
INF-RB | 0.0957 | 1,117,435 | 0.1013 | 77.19 | 1,400,524 | 9.75 |
MLR-RB-UB | 0.0823 | 943,053 | 0.0835 | 82.76 | 1,217,738 | 8.23 |
SVR-RB | 0.0702 | 817,575 | 0.0718 | 88.60 | 990,176 | 7.02 |
Stacking | 0.0614 | 648,303 | 0.0601 | 92.57 | 799,635 | 6.14 |
Date | Stacking Predicted Value | Actual Value | Percentage Error (%) |
---|---|---|---|
2023.11 | 11,259,021 | 10,683,648 | 5.39 |
2023.12 | 15,951,523 | 15,226,730 | 4.76 |
2024.01 | 16,701,125 | 17,109,964 | −2.39 |
2024.02 | 14,225,391 | 13,843,689 | 2.76 |
2024.03 | 13,317,303 | 13,270,379 | 0.35 |
2024.04 | 10,375,301 | 9,896,262 | 4.84 |
2024.05 | 10,199,972 | 9,680,592 | 5.37 |
2024.06 | 9,148,206 | 8,778,636 | 4.21 |
2024.07 | 8,987,714 | 8,687,648 | 3.45 |
2024.08 | 8,189,393 | 7,973,548 | 2.71 |
2024.09 | 8,836,944 | 9,127,189 | −3.18 |
2024.10 | 10,923,210 | 10,400,086 | 5.03 |
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
Wang, J.; Jiang, L.; Zhang, L.; Liu, Y.; Yu, Q.; Bu, Y. An Integrated Stacking Ensemble Model for Natural Gas Purchase Prediction Incorporating Multiple Features. Appl. Sci. 2025, 15, 778. https://doi.org/10.3390/app15020778
Wang J, Jiang L, Zhang L, Liu Y, Yu Q, Bu Y. An Integrated Stacking Ensemble Model for Natural Gas Purchase Prediction Incorporating Multiple Features. Applied Sciences. 2025; 15(2):778. https://doi.org/10.3390/app15020778
Chicago/Turabian StyleWang, Junjie, Lei Jiang, Le Zhang, Yaqi Liu, Qihong Yu, and Yuheng Bu. 2025. "An Integrated Stacking Ensemble Model for Natural Gas Purchase Prediction Incorporating Multiple Features" Applied Sciences 15, no. 2: 778. https://doi.org/10.3390/app15020778
APA StyleWang, J., Jiang, L., Zhang, L., Liu, Y., Yu, Q., & Bu, Y. (2025). An Integrated Stacking Ensemble Model for Natural Gas Purchase Prediction Incorporating Multiple Features. Applied Sciences, 15(2), 778. https://doi.org/10.3390/app15020778