Skip to content
Open access

Predicting pneumonia death in patients with heart failure using explainable machine learning model in a territory-wide electronic health record cohort

Oct 2026 · European Heart Journal · 0 citations

TL;DR

XGBoost achieved strong discrimination for predicting pneumonia death and identified clinically coherent risk drivers through SHAP, which supports the potential utility of explainable machine learning for risk stratification and earlier escalation of care in HF populations.

Abstract

Pneumonia is a major cause of death among patients with heart failure (HF), and improved risk prediction could enable earlier escalation of care and more proactive clinical management. However, robust prediction tools using routinely collected electronic health record (EHR) data for this HF population remain limited. ​ To develop and compare machine learning models to predict pneumonia death in patients with HF using territory-wide EHR data, and to identify key predictors driving model output. ​ This population-based machine learning study utilized territory-wide EHR data from the Clinical Data Analysis and Reporting System (CDARS) between 2010 and 2024. We assembled an adult cohort from CDARS and defined the study outcome as pneumonia death during follow-up. Candidate predictors were derived from routinely available clinical data, including demographics, lifestyle factors, comorbidities, medications, and laboratory markers. The dataset was randomly split into a training set and an internal test set at an 80:20 ratio using a fixed random seed (seed = 42). We developed and compared six supervised learning models, including logistic regression, random forest, XGBoost, linear support vector machine (SVM), extra-trees, and k-nearest neighbors (KNN), to predict pneumonia death. Model performance was assessed using the area under the receiver-operating-characteristic curve (AUROC) and the area under the precision–recall curve (PR-AUC). Model interpretability was evaluated using the Shapley Additive Explanation (SHAP) method to identify the key predictors driving model output. We further examined feature–outcome relationships using SHAP dependence analyses to characterise potential nonlinear and interaction effects. A total of 261,633 patients were included, among whom 51,371 died from pneumonia (19.6%). Among the evaluated models, XGBoost achieved the best overall discrimination, with an AUROC of 0.8770 (95% confidence interval [CI] 0.8729–0.8812) and a PR-AUC of 0.8489 (95% CI 0.8425–0.8552). Based on SHAP interpretation, the leading predictors contributing to model output included age, CRP, glucose, hemoglobin (Hb), HbA1c, and renal function markers (creatinine and eGFR), with additional contributions from cardiovascular comorbidities and medication indicators. SHAP dependence analyses further suggested a nonlinear pattern for glycaemic markers, whereby glucose values within a mid-range contributed minimally to model output, whereas more extreme glucose levels were associated with substantially larger SHAP magnitudes. In this prediction, XGBoost achieved strong discrimination for predicting pneumonia death and identified clinically coherent risk drivers through SHAP. These findings support the potential utility of explainable machine learning for risk stratification and earlier escalation of care in HF populations.ROC and SHAP analysis

Read PDF

Similar papers

Open access Oct 2026

AI/ML models for heart failure in-hospital mortality prediction using RWE: a retrospective cohort

Abstract Background Heart failure (HF) represents a major public health challenge in Portugal, associated with high mortality and healthcare costs. This study aimed to develop and validate artificial intelligence models to predict in-hospital mortality among HF patients at the Baixo Alentejo Local Health Unit, using in...

J. Diniz, S. Duarte, A. Dionísio et al. · 0 citations
Open access Oct 2026

Explainable machine learning for predicting in-hospital mortality in acute heart failure: a prospective single-center cohort study from Vietnam

Background Accurate risk stratification is essential in acute heart failure (AHF), which carries substantial in-hospital mortality. The Get With The Guidelines–Heart Failure (GWTG-HF) score is widely used, but its performance may vary across populations, and prospective data from Southeast Asia are scarce. We developed...

Sy Van Hoang, K. Nguyen, T. Nguyen et al. · 0 citations
Open access Oct 2026

Development and Validation of a Machine Learning Model for Predicting 28-Day Mortality in Patients with Sepsis-Associated Encephalopathy and Heart Failure.

IntroductionPatients with sepsis-associated encephalopathy (SAE) and heart failure (HF) represent a clinically relevant but understudied subgroup in the intensive care unit, and early risk stratification may be important for guiding management. This study aimed to develop and temporally validate machine-learning models...

Hai-Peng Wu, Kai Liu, Xiao-Yi Hu · 0 citations
Nov 2026

Abstract 8864: TRANSFORM-HF Score: A Machine Learning Survival Model for Mortality Risk Prediction After Heart Failure Hospitalization

Background: Mortality after heart failure (HF) hospitalization remains high, yet commonly used risk scores may have limited discrimination, calibration, and generalizability in contemporary practice. Contemporary models should be derived from broadly representative HF populations. Hypothesis: A machine learnin...

G. Tong, Y. Zeng, Tariq Ahmad et al. · 0 citations
Open access Nov 2026

A machine learning model for identifying heart failure in patients with chronic obstructive pulmonary disease based on routine laboratory indicators

Heart failure (HF) is a frequent and prognostically important comorbidity of chronic obstructive pulmonary disease (COPD), yet it is often documented late. We developed and temporally validated an interpretable machine learning model that identifies clinically documented comorbid HF in patients with COPD using ro...

Zhi-Long Liu, Zhi-Hong Ren, Lei Xu et al. · 0 citations
Open access Oct 2026

Machine learning–based identification of mortality risk factors in hospitalized heart failure patients: a multicenter real-world study

Despite advances in guideline-directed medical therapy, heart failure (HF) continues to carry a high burden of mortality and hospitalization. Existing risk models are largely derived from historical cohorts or highly selected clinical trial populations, which may not reflect the complexity and therapeutic standar...

A. Bednarek, Z. Wojdyńska, K. Byczkowska et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.