Construction and Validation of a Hospital Mortality Risk Model for Advanced Elderly Patients with Heart Failure Based on Machine Learning

Int J Gen Med. 2025 Jun 20:18:3277-3288. doi: 10.2147/IJGM.S514972. eCollection 2025.

Abstract

Purpose: This study aimed to develop and validate a model based on machine learning algorithms to predict the risk of in-hospital death among advanced elderly patients with Heart Failure (HF).

Methods: A total of 4580 advanced elderly patients who were admitted to the hospital and diagnosed with HF from May 2012 to September 2023 were included in this study, among whom 552 cases (12.5%) died. The least absolute shrinkage and selection operator (LASSO) regression and Boruta feature selection were used to screen the baseline variables to identify the variables significantly associated with death. Subsequently, seven different machine learning models were constructed and their prediction performances were evaluated. The Shapley Additive Explanations (SHAP) values were used to analyze the impact of key variables on the model prediction results.

Results: A total of seven variables significantly associated with death were selected by LASSO regression and Boruta feature selection, including white blood cell count (WBC), neutrophil percentage (Neut %), C-reactive protein (CRP), D-dimer, glycated serum protein (GSP), N-terminal pro-B-type natriuretic peptide (NT-ProBNP), and body mass index (BMI). Among all the models, the extreme gradient boosting (XGB) model performed the best, with an area under the curve (AUC) value of 0.933, a sensitivity of 0.79, a specificity of 0.89, a recall of 0.79, and an F1 score of 0.59 on the validation set. The SHAP analysis showed that CRP, BMI, NT-ProBNP, D-dimer, and GSP were the main influencing factors for death.

Conclusion: This study successfully constructed a prediction model for the in-hospital death risk of advanced elderly patients with HF, and the XGB model exhibited excellent prediction performance. This model can be used for the early clinical identification of high-risk patients and thus provide support for individualized treatment strategies.

Keywords: advanced elderly; death; heart failure; machine learning.