Abstract:Objective To construct machine learning prediction models for inadequate intestinal preparation for colonoscopy, compare the performance of different algorithms, and conduct model interpretability research. Methods A total of 1,200 patients who underwent elective colonoscopy at Xuzhou Cancer Hospital between January 2022 and December 2024 were retrospectively enrolled. Based on whether the intestinal preparation procedure was carried out in accordance with the standard, 987 patients who met the standard were finally selected and randomly divided into development cohort (n=691) and validation cohort (n=296) at a ratio of 7 vs. 3. Ten preoperative variables were included, and multiple sample imbalance correction schemes were compared. Logistic regression, support vector machine (SVM), random forest, and extreme gradient boosting (XGBoost) models were constructed respectively. The SHapley Additive exPlanations (SHAP) method was adopted to analyze the feature contribution of the optimal model. Results The incidence of inadequate intestinal preparation in patients with standardized intestinal preparation was 16.6%, and SMOTENC was the optimal sample correction strategy. In the validation cohort, the area under the curve (AUC) of the XGBoost model was 0.824 (95%CI: 0.758?0.890), the sensitivity was 81.6%, the specificity was 78.1%, the F1 value was 0.559, and the Brier score was 0.111. Chronic constipation, previous history of intestinal preparation failure, and defecation less than 3 times per week were the main risk factors for inadequate intestinal preparation. Conclusion The machine learning model constructed based on conventional preoperative indicators can effectively identify high-risk patients who still have the risk of poor intestinal cleanliness even after completing the standard intestinal preparation. Among them, XGBoost has the best prediction performance. Combined with the SHAP method, individualized risk interpretation can be achieved, which can provide a basis for clinical precise intervention.