This retrospective study evaluated frailty risk and predictors in 1,498 hospitalized patients aged 65 years or older with heart failure (HF) complicated by acute infections at Nanjing First Hospital in 2023. Frailty prevalence was 80.3% by the Clinical Frailty Scale (CFS). Candidate predictors were screened by univariate analysis and LASSO, and eight machine learning algorithms were compared. The eXtreme Gradient Boosting (XGBoost) model achieved the best discrimination (AUROC 0.872; AUPRC 0.969). Important predictors included use of thiazide diuretics, serum albumin, estimated glomerular filtration rate (eGFR), lymphocyte percentage, mean corpuscular hemoglobin concentration (MCHC), capacity for action, age, left ventricular ejection fraction (LVEF), NYHA functional class, history of cerebral infarction, and smoking. Model interpretability was provided using SHAP and an online calculator was developed as a proof of concept.
Frailty is a multidimensional geriatric syndrome characterized by reduced physiologic reserve and diminished resilience to stressors. It is common among hospitalized patients and is associated with worse outcomes, including disability and mortality. Heart failure (HF) is itself a complex syndrome often coexisting with frailty. The combination of HF and acute infections creates overlapping pathophysiology—fluid retention from HF and fluid loss or exudation from infection—that may worsen fluid balance, mobility, and muscle strength, raising frailty risk and complicating management.
Prior frailty prediction work has mainly addressed stable chronic populations and has limitations such as small sample sizes, omission of objective laboratory measures, and limited model interpretability. Machine learning approaches can improve discrimination but often lack transparent explanation of individual predictions. SHapley Additive exPlanations (SHAP) offers a way to quantify feature contributions at the individual level, improving clinical interpretability.
This study aimed to identify frailty-associated factors in hospitalized older adults with HF and acute infections and to develop an interpretable machine learning model for frailty prediction, accompanied by an online calculator to enable bedside or clinic use.
Design and participants
Clinical data were collected for patients admitted with HF and concurrent acute infections between January 1 and December 31, 2023, at Nanjing First Hospital. Data access for research occurred on 15 April 2025 from electronic medical records. Inclusion criteria were age ≥65 years, HF diagnosed per the Chinese Guidelines for Diagnosis and Treatment of Heart Failure 2024, and clinical or laboratory evidence of an acute infection. Exclusion criteria included incomplete records, absence of infection, and comorbid conditions such as acute myocardial infarction, advanced malignancy, psychiatric disorders, severe trauma, or NYHA class I. The Ethics Committee approved the study (Approval No. KY20250120-KS-03) and waived informed consent due to the retrospective design.
Frailty assessment and outcome definition
Frailty was assessed using the Clinical Frailty Scale (CFS). The primary outcome for the predictive modeling was frailty status as defined by the CFS. The cohort was randomly split into training and test sets at a 7:3 ratio for model development and evaluation.
Predictor selection and model development
Potential predictors encompassed demographics, comorbidities, medication use, routine laboratory values, and cardiac function indices. Initial screening used univariate analysis followed by least absolute shrinkage and selection operator (LASSO) regression to select candidate features. Eight machine learning algorithms were trained and compared, including eXtreme Gradient Boosting (XGBoost) among others. Model interpretability was implemented with SHAP to quantify the marginal contribution of each predictor to individual-level predictions. An online calculator was developed to demonstrate real-time risk estimation using the final model.
Among the eight evaluated algorithms, XGBoost produced the best predictive performance with AUROC 0.872 and AUPRC 0.969 on the test set. The SHAP analysis identified the most influential predictors for frailty probability. Predictors associated with lower frailty probability included use of thiazide diuretics; other top contributors associated with frailty probability included lower serum albumin, reduced eGFR, lower lymphocyte percentage, altered mean corpuscular hemoglobin concentration (MCHC), reduced capacity for action, older age, lower left ventricular ejection fraction (LVEF), higher NYHA functional class, prior cerebral infarction, and smoking. The SHAP framework was used to provide local (individual) and global (cohort-level) explanations of feature importance.
An online calculator implementing the model was created as a proof-of-concept to facilitate bedside or clinic estimation of frailty risk based on patient-specific inputs.
This study addresses frailty prediction in a clinically relevant but understudied population—older adults hospitalized with HF and acute infections—by combining routine clinical and laboratory data with machine learning and model interpretability. The high frailty prevalence (80.3%) underscores the burden of vulnerability in this group. The identification of thiazide diuretics as an independent predictor associated with lower frailty probability is a notable finding reported by the authors; the study presents this as an association observed in the cohort rather than a causal conclusion.
The use of XGBoost delivered strong discrimination, while SHAP enhanced transparency by showing how each predictor influenced individual risk estimates, potentially improving clinical trust and adoption. The online calculator illustrates a pathway toward real-time risk stratification and individualized intervention planning.
As reported in the source, this is a single-center, retrospective study limited to patients meeting specific inclusion and exclusion criteria; these design choices may limit generalizability. The observational nature of the data prevents causal inference, and details about some variables or subgroup analyses were not reported in the source. The authors note these limitations in the original manuscript.
In a cohort of 1,498 older inpatients with HF and acute infections, frailty was common. An interpretable machine learning model, with XGBoost as the top performer and SHAP for explanation, identified multiple predictors of frailty risk. Use of thiazide diuretics was associated with a lower probability of frailty in this dataset. An online calculator was developed to demonstrate potential clinical application. The authors provide data availability via a public repository and report ethical approval for the study.