Key result
XGBoost reclassifies unspecified heart failure into HFpEF or HFrEF with an AUROC of ~0.71.
Why the study?
Electronic health record diagnostic codes infrequently distinguish HFpEF from HFrEF, and patients coded with unspecified HF less frequently receive guideline-directed medicines and experience worse outcomes. This study sought to develop an EHR-based machine learning algorithm to reclassify individuals with unspecified HF as having HFpEF or HFrEF.
Can supervised machine learning algorithms using primary care EHR variables accurately reclassify individuals with unspecified heart failure into HFpEF or HFrEF phenotypes in adults aged ≥40 years?
Cohort (n=3,537,285)
Yes
Can supervised machine learning algorithms using primary care EHR variables accurately reclassify individuals with unspecified heart failure into HFpEF or HFrEF phenotypes in adults aged ≥40 years?
Answers are grounded in this paper and cite their sources.
Supervised machine learning models applied to routine UK primary care EHR data can reclassify nearly half of patients with unspecified heart failure into HFpEF or HFrEF with a 75% probability of correct classification, potentially enabling better targeting of guideline-directed medical therapy.
Background Heart failure (HF) is common and associated with morbidity and mortality. Treatment for HF with guideline-directed medicines improves prognosis and reduces the risk of HF hospitalisation [1]. Treatments for HF differ by ejection fraction phenotype. However, diagnostic codes in electronic health records (EHRs) infrequently reflect this, and individuals where HF is not coded as preserved (HFpEF) or reduced ejection fraction (HFrEF), herein referred to as ‘unspecified HF’, less frequently receive guideline-directed medicines and experience worse outcomes [2]. Objective To develop an algorithm in EHR data to reclassify individuals with ‘unspecified’ heart failure to HF with HFpEF or HFrEF. Methods We used primary care EHR data from individuals aged ≥40 years with a HF diagnostic code in the UK Clinical Practice Research Datalink-AURUM dataset between January 1998 and December 2021. We took the subpopulation with diagnostic codes consistent with HFpEF or HFrEF, divided into a training and testing dataset (80:20). We trained machine learning algorithms to predict HFpEF or HFrEF using 20 variables including demographic factors, comorbidities and medicines, chosen using a supervised binary search of the predictor space [3]. Prediction performance was evaluated with area under the receiver operating characteristic curve (AUROC). Prediction thresholds for HFpEF and HFrEF reclassification were selected using the likelihood ratio for a predefined probability of correct HF classification. Individuals with unspecified-HF were reclassified to either HFpEF or HFrEF using the best-performing model and derived thresholds. Results Of a cohort of 3,537,285 individuals, 28,832 (0.8%) were recorded as having HFpEF; 122,972 (3.5%) as HFrEF; and 580,793 (16.4%) as unspecified-HF (Table 1). Compared to the HFrEF cohort, the HFpEF cohort were older, more commonly women, and had a higher BMI. Among the trained models, XGBoost showed the best prediction performance (AUROC: XGBoost, 0.706 (95% CI 0.699-0.714); random forest, 0.702 (95% CI 0.695-0.709); logistic regression, 0.698 (95% CI 0.691-0.706)). Of the individuals diagnosed with unspecified-HF, XGBoost was able to reclassify 143,389 (24.7%) to HFpEF and 133,386 (23.0%) to HFrEF at a 75% probability of correct classification for both groups (Figure 1). Using stricter thresholds corresponding to a 90% probability of correct classification, 7,947 (1.4%) individuals with unspecified-HF were reclassified to HFpEF and 23,445 (4.0%) to HFrEF. Conclusion Supervised machine learning approaches in EHRs can be used to reclassify data phenotypes to more closely align with clinically actionable phenotypes. This model could be used at scale in UK primary care data to identify individuals with HF whose care can be improved through appropriate recognition of their HF phenotype.
No takes yet. Share an insight, caveat, or question.
Hayward et al. (2026) conducted a cohort in Heart failure (HFpEF, HFrEF, and unspecified HF) (n=3,537,285). XGBoost machine learning algorithm vs. Random forest and logistic regression models was evaluated on Prediction performance (AUROC) for classifying HFpEF vs HFrEF and reclassification rate of unspecified HF (AUROC 0.706, 95% CI 0.699-0.714). XGBoost achieved an AUROC of 0.706 (95% CI 0.699-0.714), reclassifying 24.7% of unspecified HF patients to HFpEF and 23.0% to HFrEF at a 75% probability threshold.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: