Development and Validation of a Machine Learning Model for Predicting Postoperative Delirium in Elderly Patients with Hip Fracture: A Retrospective Cohort Study
Postoperative delirium; Hip fracture; Machine learning; Elderly patients; Prediction model; Random Forest
Published online: Apr 20 2026
Abstract
Postoperative delirium (POD) is a common and serious complication in elderly hip fracture patients, including those undergoing surgery for femoral neck fractures and intertrochanteric fractures, and is associated with poor clinical outcomes. Early identification of at-risk individuals remains challenging with conventional methods. To develop and validate machine learning models for predicting POD using preoperative variables, and to identify key risk factors, we conducted a retrospective study of 400 patients aged ≥65 years undergoing hip fracture surgery. Five machine learning algorithms were developed and validated using 70-30 split with 10-fold cross-validation. Results demonstrated that POD incidence was 20.0% (80/400). Significant predictors included age (OR=1.06, 95%CI:1.02-1.10), cognitive impairment (OR=2.85, 95%CI:1.70-4.78), hypoalbuminemia (OR=2.32, 95%CI:1.45-3.71), and preoperative waiting time (OR=1.18, 95%CI:1.06-1.32). The Random Forest model demonstrated superior performance (AUC=0.89, accuracy=0.83), outperforming other algorithms (XGBoost AUC=0.87, SVM AUC=0.84, Logistic Regression AUC=0.82, Decision Tree AUC=0.79). Variable importance analysis consistently identified cognitive impairment, hypoalbuminemia, and age as the most prominent predictors across all models. In conclusion, machine learning models, particularly Random Forest, effectively predict POD risk using routine preoperative data. Within our study cohort, machine learning models, particularly Random Forest, showed potential for predicting POD risk using routine preoperative data upon internal validation. The consistent identification of key predictors enables targeted prevention strategies for high- risk elderly hip fracture patients. The broader applicability of the model requires confirmation through external validation in future studies. The consistent identification of key predictors enables targeted prevention strategies for high-risk elderly hip fracture patients.