Abstract
BACKGROUND: Endoscopic retrograde cholangiopancreatography (ERCP) is the preferred palliative treatment for patients with unresectable malignant biliary obstruction (MBO), which can relieve biliary obstruction and prolong survival. Post-ERCP cholangitis (PEC) affects the survival of MBO patients. Early prediction of PEC risk is crucial for developing individualized treatment plans and improving prognosis. Currently, no predictive models exist for clinical practice. This study aims to develop and validate an interpretable machine learning prediction model using multicenter cohorts to predict the risk of PEC. METHODS: We collected data from 2831 unresectable MBO patients who underwent ERCP between January 2011 and December 2023. After screening, data from 1026 patients from the First Hospital of Jilin University served as training and internal test cohorts, while data from 395 patients from the Third Hospital of Jilin University were used as an external validation cohort. Six machine learning methods were employed to construct prediction models. Model performance was compared using various metrics. The SHapley Additive exPlanation (SHAP) method was used to interpret the final model. RESULTS: Among all MBO patients, the incidence of PEC was 9.5% (135/1421). Multivariate analysis identified radiofrequency ablation (OR = 3.62, 95% CI 1.26-10.36), white blood cell count (OR = 1.34, 95% CI 1.12-1.60), moderate jaundice (OR = 3.57, 95% CI 1.06-12.09), and abnormal serum amylase (OR = 3.05, 95% CI 1.36-6.79) as independent risk factors for PEC. Four important variables were selected through machine learning methods: radiofrequency ablation, white blood cell count, severity of jaundice, and serum amylase. Among the six machine learning models, the XGBoost model performed best (training cohort AUC: 0.9654). This model accurately predicted PEC risk in MBO patients in both the internal test cohort (AUC: 0.7670) and external validation cohort (AUC: 0.7270). Calibration curves showed good consistency between predicted and observed risks. Decision curve analysis indicated that the model provided substantial clinical net benefit. CONCLUSION: Based on multicenter, large-sample data, we developed and validated an interpretable XGBoost model for predicting PEC risk in MBO patients. This model helps clinicians identify high-risk patients preoperatively, providing a basis for individualized treatment plans and thereby improving patient prognosis.