Interpretable and explainable predictive machine learning models for gastric retention before gastroscopy - Yun Dai; Huan-Zhong Su; Hong-Bin Zhang; Jin-Hai Chen; Guo-Xing Xu; Hai-Xing Wang (Frontiers in Medicine, 2026)
Background Early detection of gastric retention (GR) is challenging in clinical practice. We aimed to develop and validate interpretable machine learning (ML) models for predicting GR risk using routinely available clinical features. Methods This retrospective study enrolled 3,233 consecutive patients (training cohort: n = 2,263; validation cohort: n = 970) who underwent gastroscopy between January 2022 and December 2024. To address class imbalance, the Synthetic Minority Over-sampling Technique (SMOTE) was applied prior to model development. Optimal features were selected via least absolute shrinkage and selection operator (LASSO) regression within the SMOTE-enhanced training cohort, with different predictive models constructed using nine machine learning (ML) algorithms. Ten-fold cross-validation on SMOTE-enhanced training cohort was used for hyperparameter tuning. Model performance was primarily assessed on the validation cohort using the area under the receiver operating characteristic curve (AUC), calibration plots, and decision curve analysis (DCA). Results LASSO regression identified 12 clinically actionable predictors from 19 candidate variables, which were subsequently used to develop nine ML models. Among these models, the extreme gradient boosting (XGBoost) model achieved the highest AUC value of 0.710 (95% CI: 0.681–0.738) in the validation cohort. Decision curve analysis revealed that the XGBoost model exhibited superior clinical utility compared to other models. Shapley Additive Explanations (SHAP) identified the use of anticholinergic drugs, pyloric obstruction, analgesic use, systemic diseases, and a history of gastrointestinal surgery as the top five important predictive features. Conclusions This study establishes an interpretable GR risk stratification model using routinely available preoperative variables. The model may serve as an auxiliary screening aid for pre-gastroscopy risk assessment.