# Explainable Ensemble Learning Model for Residual Strength Forecasting of Defective Pipelines
## 4 Conclusions  
(1) The stratified sampling method divides the training set and the test set, effectively avoiding the significant deviation caused by random sampling and ensuring the reliability and objectivity of the prediction results. The Bayesian optimization algorithm is proposed to solve the problems of excessive iterations and high computational cost of traditional hyperparameter optimization methods. A novel hybrid forecasting model, BO-XGBoost, is proposed. The model is evaluated based on metrics such as RE, MAPE, R\({}^{2}\), and RMSE, along with robustness, overfitting, and grey relational analysis, verifying that the constructed model exhibits high predictive performance.  
(2) The SHAP was used to study the influence of input variables on model output, which enhanced the explainability of model prediction, met industry requirements on the explainability of prediction models, and enhanced the guiding role of the model for production practice. The establishment of this model contributes to advancing the integrity management level of oil and gas pipelines, providing critical decision-making support for intelligent management of pipeline systems, and this methodology is equally applicable in the fields of gas and water pipelines.  
(3) The residual strength prediction model for defective pipelines is deployed on data-acquisition terminals through algorithmic encapsulation. The model dynamically updates prediction results in real time by integrating data from sensors and monitoring systems. The software can assess the pipeline's safety status in case of defects, and when the predicted  
Figure 14: Ranking of contribution residual strength influencing factors.  
Figure 15: Effect of different input characteristics on the prediction model.  
residual strength is below the safety threshold, the system will give an early warning. Such alerts prompt maintenance personnel to implement timely repair or replacement measures, thereby preventing pipeline failures and guiding predictive maintenance strategies.  
(4) The research on residual strength prediction of defective pipelines based on XGBoost has important theoretical significance and practical application value. Future research in data enhancement, multi-modal data fusion, model optimization, real-time data monitoring, and interpretability improvement is expected to further improve the prediction accuracy and practicability and provide strong support for the safe operation of pipelines.  
Conceptualization, H.L.; Methodology, H.L.; Resources, X.M.; Writing--original draft, H.L.; Writing--review & editing, H.L.; Supervision, X.M.; Project administration, X.M. All authors have read and agreed to the published version of the manuscript.  
This research received no funding.  
Not applicable.  
The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.  
Author [PERSON] was employed by the company Shaanxi Provincial Natural Gas Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.