Predicting the risk of postoperative constipation in middle-aged and elderly patients with lower limb fractures using machine learning algorithms

X Xiaoyan Yang W Wenqiang Li Q Qin Xiao S Shiyun Du X Xi Wang Y Ying Zhang S Sulian Li

Abstract

Objective To construct and validate a predictive model for the risk of postoperative constipation in middle-aged and elderly patients with lower limb fractures based on machine learning algorithms, so as to provide decision-making support for clinical prevention and early intervention. Methods This study conducted a retrospective analysis of clinical data of 1,128 middle-aged and elderly patients who underwent lower limb fracture surgery between January 2020 and May 2024, with data collection occurring from October to December 2024. Whether constipation occurred or not was used as the outcome variable. Eight machine learning algorithms, namely logistic regression (LR), extreme gradient boosting (XGBoost), random forest (RF), decision tree classifier (DT), complement naive bayes (CNB), multilayer perceptron (MLP), support vector machine (SVM), and K-Nearest neighbors (KNN), were employed to construct predictive models. Key risk factors were identified using SHAP (SHapley Additive exPlanations), a game theory-based approach for analyzing feature importance. Model predictive performance was comprehensively evaluated using metrics including the area under the receiver operating characteristic curve (AUC), accuracy, and other relevant indicators. Results The logistic regression (LR) model demonstrated the optimal predictive performance. Age, femoral fracture, length of hospital stay, nutritional risk, and chronic gastritis were identified as important predictive factors. This model can be integrated into the clinical information system to automatically flag high-risk patients upon admission and provide individualized interventions based on risk stratification. Conclusion The logistic regression (LR) model developed in this study exhibits strong discriminative ability and clinical utility, enabling dynamic perioperative monitoring of constipation risk through digital health tools, thereby potentially reducing related complications.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 20, Issue 11
Published November 21, 2025
Pages e0336466
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (7)

X

Xiaoyan Yang

W

Wenqiang Li

Q

Qin Xiao

S

Shiyun Du

X

Xi Wang

Y

Ying Zhang

S

Sulian Li