| Objective? To establish an XGBoost model by integrating clinical indicators and immune inflammation indicators to predict the risk of postoperative infection in elderly patients with hip fracture, so as to provide reference for early intervention. Methods? A total of 342 elderly patients with hip fracture surgery in Chengdu Fifth People"s Hospital from January 2021 to March 2024 were selected as the modeling set, and 146 elderly patients with hip fracture surgery in our hospital from April 2024 to March 2025 were selected as the verification set. The postoperative infection was divided into infected group and non-infected group according to whether postoperative infection occurred. The clinical indicators and immune inflammatory indicators [high-sensitivity C-reactive protein (hs-CRP), interleukin-6 (IL-6), neutrophil-to-lymphocyte ratio (NLR), systemic immune inflammatory index (SII)] were compared between the two groups. The extreme gradient boosting (XGBoost) algorithm was used to construct a prediction model for the risk of postoperative infection in elderly patients with hip fracture, and the importance of each feature was output. The SHAP value was used to explain the individual prediction, and the receiver operating characteristic curve (ROC curve) and clinical decision curve (DCA curve) were used for verification. Results ? Pulmonary infection was the most common postoperative infection in elderly patients with hip fracture. The pulmonary infection rates in the modeling set and the validation set were 52.78% and 53.57%, respectively. In the modeling set and validation set, the proportion of diabetes, the proportion of coronary heart disease, total cholesterol, RDW, hs-CRP, IL-6, NLR and SII in the infection group were higher than those in the non-infection group, and the albumin level was lower than that in the non-infection group (P<0.05). The absolute values of SHAP values of each feature in the XGBoost model were ranked as follows: IL-6, hs-CRP, albumin, SII, NLR, RDW, diabetes; in the modeling set and validation set, the AUC values of ROC curve of XGBoost model in predicting postoperative infection of elderly hip fracture were 0.938 ( 95%CI: 0.884-0.991) and 0.919 (95%CI: 0.859-0.979 ), respectively. The DCA curve showed that the XGBoost model for predicting postoperative infection in elderly patients with hip fracture had good clinical practicability in both the modeling set and the validation set. Conclusion Diabetes mellitus, albumin, RDW, hs-CRP, IL-6, NLR and SII are independent predictors of postoperative infection in elderly patients with hip fracture. The XGBoost model constructed by combining the above indicators to predict the risk of postoperative infection has clinical guiding significance for the prevention and treatment of postoperative infection in elderly patients with hip fracture. |