Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Apr 23;25(1):268.
doi: 10.1186/s12877-025-05920-x.

Elucidating predictors of preoperative acute heart failure in older people with hip fractures through machine learning and SHAP analysis: a retrospective cohort study

Affiliations

Elucidating predictors of preoperative acute heart failure in older people with hip fractures through machine learning and SHAP analysis: a retrospective cohort study

Qili Yu et al. BMC Geriatr. .

Abstract

Background: Acute heart failure (AHF) has become a significant challenge in older people with hip fractures. Timely identification and assessment of preoperative AHF have become key factors in reducing surgical risks and improving outcomes.

Objective: This study aims to precisely predict the risk of AHF in older people with hip fractures before surgery through machine learning techniques and SHapley Additive exPlanations (SHAP), providing a scientific basis for clinicians to optimize patient management strategies and reduce adverse events.

Methods: A retrospective study design was employed, selecting patients admitted for hip surgery in the Department of Geriatric Orthopedics at the Third Hospital of Hebei Medical University from January 2018 to December 2022 as research subjects. Data were analyzed using logistic regression, random forests, support vector machines, AdaBoost, XGBoost, and GBM machine learning methods combined with SHAP analysis to interpret relevant factors and assess the risk of AHF.

Results: A total of 2,631 patients were included in the final cohort, with an average age of 79.3 ± 7.7. 33.7% of patients experienced AHF before surgery. A predictive model for preoperative AHF in older people hip fracture patients was established through multivariate logistics regression: Logit(P) = -2.262-0.315 × Sex + 0.673 × Age + 0.556 × Coronary heart disease + 0.908 × Pulmonary infection + 0.839 × Ventricular arrhythmia + 2.058 × Acute myocardial infarction + 0.442 × Anemia + 0.496 × Hypokalemia + 0.588 × Hypoalbuminemia, with a model nomogram established and an AUC of 0.767 (0.723-0.799). Predictive models were also established using five machine learning methods, with GBM performing optimally, achieving an AUC of 0.757 (0.721-0.792). SHAP analysis revealed the importance of all variables, identifying acute myocardial infarction as the most critical predictor and further explaining the interactions between significant variables.

Conclusion: This study successfully developed a predictive model based on machine learning that accurately predicts the risk of AHF in older people with hip fractures before surgery. The application of SHAP enhanced the model's interpretability, providing a powerful tool for clinicians to identify high-risk patients and take appropriate preventive and therapeutic measures in preoperative management.

Keywords: Heart failure; Hip fracture; Machine learning; Prediction model; Preoperative; SHAP.

PubMed Disclaimer

Conflict of interest statement

Declarations. Ethics approval and consent to participate: The ethical review board of the Third Hospital of Hebei Medical University evaluated and sanctioned this research protocol, ensuring adherence to the Helsinki Declaration. The approval was granted under the reference number 2021–087 − 1. Due to the retrospective nature of data gathering in this study, the board also provided a waiver for informed consent. Prior to analysis, all patient data were anonymized to protect privacy. Consent for publication: Not applicable. Competing interests: The authors declare no competing interests.

Figures

Fig. 1
Fig. 1
The patient flow chart in our study
Fig. 2
Fig. 2
Forest plot showing the relationship between risk factors and the occurrence of preoperative acute heart failure in older people with hip fracture
Fig. 3
Fig. 3
A nomogram model for predicting the occurrence of preoperative acute heart failure in older people with hip fractures
Fig. 4
Fig. 4
Calibration curves of the acute heart failure nomogram prediction in the cohort. Panel A shows the calibration curve for the training dataset, and Panel B shows the curve for the test dataset. The x-axis represents the predicted acute heart failure risk. The y-axis represents the actual diagnosed acute heart failure. The diagonal dotted line represents a perfect prediction by an ideal model. The solid line represents the performance of the nomogram, of which a closer fit to the diagonal dotted line represents a better prediction
Fig. 5
Fig. 5
Analysis of the ROC curve for the predictive values of preoperative acute heart conditions. The blue curve represents the ROC for the training set, with an area under the curve (AUC) of 0.761 (95% CI: 0.740–0.786), illustrating the model’s performance on the dataset used for model development. The red curve represents the ROC for the validation set, with an AUC of 0.767 (95% CI: 0.723–0.799), indicating the model’s performance on a separate dataset used to test the model. The dashed diagonal line represents the line of no discrimination, which a purely random classifier would achieve. The closer the ROC curve is to the top left corner, the higher the test’s overall accuracy
Fig. 6
Fig. 6
Decision curve analysis (DCA) and Clinical Impact Curves (CIC) for the acute heart failure nomogram. A and B depict the DCA for the training and test datasets respectively, with the y-axis measuring net benefit. The blue line in each represents the performance of the acute heart failure risk nomogram. The grey solid line assumes all patients have acute heart failure, and the grey dashed line assumes no patients have the condition. C and D show the CIC for the training and test datasets respectively, with the y-axis indicating the number of patients. In C and D, the solid blue line represents high-risk patients as identified by the nomogram, and the dashed red line indicates the actual patients with heart failure. These graphs suggest that the nomogram provides a positive net benefit for clinical decision-making within a probability threshold range
Fig. 7
Fig. 7
Variable Importance and Correlation Matrix from Preprocessed Data in Machine Learning Model Analysis. A displays the variable importance scores, with the most significant features for the model’s standardization being Acute Myocardial Infarction, Ventricular Arrhythmia, Pulmonary Infection, and Anemia. B shows the correlation matrix of the variables, with red indicating a strong positive correlation, blue a strong negative correlation, and white indicating no correlation. These visualizations provide the relationships between different clinical variables
Fig. 8
Fig. 8
Receiver Operating Characteristic (ROC) curves for various machine learning models in the evaluation of the dataset. The curves compare the sensitivity (true positive rate) and 1 - specificity (false positive rate) across different thresholds for Random Forest (RF), Support Vector Machine (SVM), AdaBoost, Extreme Gradient Boosting (XGBoost), and Gradient Boosting Machine (GBM). Area Under the Curve (AUC) values are displayed in the legend, with GBM showing the highest AUC of 0.757
Fig. 9
Fig. 9
SHAP value analysis for predictive modeling of acute heart Failure in older people with hip fractures. This Feature Importance Plot visualizes the impact of individual features on the prediction of acute heart failure risk. Each dot represents an observation, plotted against its SHAP value on the x-axis. The direction and magnitude of these SHAP values indicate whether the feature increases (positive value) or decreases (negative value) the risk of acute heart failure according to the model. The color gradient signifies the value of the feature, ranging from low (purple) to high (yellow)
Fig. 10
Fig. 10
SHAP value distributions for individual predictive analysis across four patients (A-D). These plots display the influence of various clinical features on the model’s prediction of acute heart failure risk for each patient. In each subfigure, the x-axis represents the SHAP value, indicating the impact level of each feature. Features with higher SHAP values contribute more significantly to the prediction. Across all patients, Acute Myocardial Infarction is consistently the most influential variable with the highest SHAP values, indicating a strong association with increased heart failure risk
Fig. 11
Fig. 11
Multivariate dependence plots demonstrating feature interactions in acute heart failure risk prediction. Each plot illustrates the relationship between a specific feature and SHAP values, which quantify the impact on the model’s output. The color gradient, from purple to yellow, shows the value of one feature relative to another, with yellow indicating higher values. The plots reveal non-linear interactions between features, indicating complex relationships that are crucial for understanding the model’s predictions

Similar articles

References

    1. Gullberg B, Johnell O, Kanis JA. World-wide projections for hip fracture. Osteoporos INT. 1997;7(5):407–13. - PubMed
    1. Tewari P, Sweeney JBF, Lemos JL, Shapiro L, Gardner MJ, Morris AM, Baker LC, Harris AS, Kamal RN. Evaluation of systemwide improvement programs to optimize time to surgery for patients with hip fractures: A systematic review. Jama Netw Open. 2022;5(9):e2231911. - PMC - PubMed
    1. Boddaert J, Raux M, Khiami F, Riou B. Perioperative management of elderly patients with hip fracture. Anesthesiology. 2014;121(6):1336–41. - PubMed
    1. Duceppe E, Patel A, Chan M, Berwanger O, Ackland G, Kavsak PA, Rodseth R, Biccard B, Chow CK, Borges FK, et al. Preoperative N-Terminal Pro-B-Type natriuretic peptide and cardiovascular events after noncardiac surgery: A cohort study. Ann Intern Med. 2020;172(2):96–104. - PubMed
    1. Shameer K, Johnson KW, Glicksberg BS, Dudley JT, Sengupta PP. Machine learning in cardiovascular medicine: are we there yet? Heart. 2018;104(14):1156–1164. - PubMed

LinkOut - more resources