Abstract Background Delayed closure of a temporary ileostomy in patients with rectal cancer may cause psychological, physiological, and soci
Abstract Background Delayed closure of a temporary ileostomy in patients with rectal cancer may cause psychological, physiological, and socioeconomic burdens to patients. Purpose This study aimed to develop and validate a machine learning-based model to predict the delayed ileostomy closure after surgery in patients with rectal cancer. Design A retrospective study. Methods LASSO regression was used for feature screening, and XGBoost was used for machine learning model construction. Model performance was assessed by receiver operating characteristic (ROC) curve analysis, calibration curve analysis, clinical decision curve analysis, sensitivity, specificity, accuracy, and F1 score. The SHAP method was used to interpretate the results of the machine learning model. Results A total of 442 rectal cancer patients who received a loop ileostomy were included in this study, and 305 experienced delayed closure (69%). The XGBoost model area under the ROC curve (AUC) of the training set was 0.744 (95% confidence interval [CI]: 0.686–0.806) and of the test set was 0.809 (95% CI: 0.728–0.889). The importance of each variable, in descending order was body mass index (BMI), postoperative chemotherapy, distance from tumor to anal margin, depth of tumor infiltration, neoadjuvant chemoradiotherapy, and anastomotic stenosis. The importance of SHAP variables in the model from high to low was: ‘BMI’ ‘postoperative chemotherapy’ ‘distance of the tumor from the anal verge’ ‘depth of tumor infiltration’ ‘neoadjuvant radiotherapy’ ‘anastomotic stenosis’. Conclusion The XGBoost machine learning model we constructed showed good performance in predicting delayed closure of loop ileostomy in rectal cancer patients. In addition, the SHAP method can help better understand the results of machine learning models.