Construction and validation of a machine learning model for predicting anastomotic leak following radical esophagectomy for esophageal cancer
Yueying Yang, Kayishaer Ainiwaer, Yunfei Gao, An Li, Abulajiang Kamili, Dongbo Luo
Background Early identification of patients at high risk of anastomotic leak (AL) following esophagectomy is essential for improving surgical outcomes. However, reliable preoperative risk stratification remains challenging. This study aimed to predict AL risk in the esophageal cancer (EC) population by developing and validating a machine learning (ML)-based model using exclusively preoperative and baseline clinical data. Methods A retrospective cohort of EC patients who underwent radical esophagectomy at the Affiliated Tumor Hospital of Xinjiang Medical University from January 2020 to May 2025 was analyzed. Feature selection was performed using the least absolute shrinkage and selection operator (LASSO) regression. Five ML algorithms, Random Forest (RF), Support Vector Machine (SVM), Logistic Regression (LR), Extreme Gradient Boosting (XGBoost), and Light Gradient Boosting Machine (LightGBM), were constructed. Model performance was comprehensively evaluated using the area under the receiver operating characteristic (ROC) curve (AUC), calibration curves, and decision curve analysis (DCA). Model interpretability was enhanced via Shapley Additive Explanations (SHAP), enabling quantification of feature importance and visualization of individual prediction contributions. Results A total of 368 patients were included and randomized to training (n=258) and validation (n=110) cohorts. Among the models, RF displayed the best discriminative performance in the validation cohort (AUC: 0.803, 95% confidence interval [CI]: 0.717-0.892), followed by XGBoost (AUC: 0.723) and LightGBM (AUC: 0.713). The RF model yielded a sensitivity (SEN) of 0.879 and a specificity (SPE) of 0.571. SHAP analysis identified monocytes, carcinoembryonic antigen (CEA), neutrophil-to-lymphocyte ratio (NLR), urine creatinine (UCr), and T stage as the five most influential predictors of AL. Calibration curves for the ensemble models demonstrated good agreement between predicted probabilities and observed outcomes. Conclusions The RF model, incorporating five routinely available preoperative variables, exhibited robust discriminative performance with high SEN for predicting in-hospital AL following esophagectomy. The proposed threshold-based risk stratification approach may facilitate individualized perioperative monitoring and management.