Heart failure research / MIMIC-IV

Heart failure risk
across three patient representations

How much does the shape of a patient's history matter? Eight models compare an aggregated record, an admission sequence, and a patient-similarity graph. Less than expected: a well-built flat record with a tree model stayed on top.

Patient history
Admission 1
Admission 2
Admission 3
Illustrative anatomical heart with a tapered apex, aortic arch, pulmonary trunk and coronary vessels
Illustrative heartbeat · 72 bpmStill illustration / reduced motion

12-month leader XGBoost

0.9545

18-month leader Random Forest

0.9525
Test-set AUROC / Tables 4.6 and 4.7
8 core models195 aggregated features12 & 18 month windows9,371 & 11,496 patients

The question

Does a richer patient history make a better model?

Most heart failure risk models flatten a patient's history into one row of features. That is easy to model, but it drops the order of admissions and the links between clinical events.

This research compares three representations using MIMIC-IV v3.1. None of the studies reviewed for this project compared all three on one cohort. The core question is whether preserving that structure improves heart failure classification enough to justify the added complexity.

RQ1

Does an admission sequence or patient-similarity graph outperform an aggregated feature vector?

RQ2

What does richer information add, and how much signal comes from medication history?

Retrospective risk-stratification research, for teams deciding whether sequence or graph modelling is worth adopting on hospital records. Results describe the study cohorts, not a validated clinical prediction service.

Three representations

The same history,
three ways to read it

Each representation retains a different part of the clinical record. Select a view to see what the model receives.

History summarised

One record, 195 features

Diagnosis flags, medication counts, and laboratory summaries become one vector. It preserves what happened within the window, but not the order of admissions.

Read by

Logistic Regression, MLP, SVM, Random Forest, XGBoost, FT-Transformer

Cohort construction

Two windows,
built independently

Cases and controls are matched by gender and ten-year age band. Features exclude admissions on or after each patient's index date.

Patients with a heart failure code31,369ICD-9 428.x or ICD-10 I50.x

12 months

  1. Eligible heart failure cases2,520Two or more pre-index admissions
  2. Matched cohort9,371Cases and age/gender-matched controls
  3. Sequence-eligible subset4,368Usable admission history for the GRU

18 months

  1. Eligible heart failure cases3,099Two or more pre-index admissions
  2. Matched cohort11,496Cases and age/gender-matched controls
  3. Sequence-eligible subset5,658Usable admission history for the GRU
The two windows are constructed independently. Matching adds controls, so the cohort grows at that step. Boxes show stages, not relative population sizes. Source: Section 3.3 and Table 3.2.

Controls are matched three to one, relaxing to two to one above age eighty where the pool is smaller. The sequence-eligible subset contains fewer patients than the full matched cohort.

Feature schema

A shared foundation
of 195 features

Both windows use the same aggregated schema. Diagnosis flags form most of the vector; medications and laboratory measurements add a different kind of history.

195features
at both windows

Three-character diagnosis roots retained by the study's feature-selection rule.

Select a category to locate its features. One cell equals one feature. Source: Table 3.3.

Data leakage

A timestamp can hide where an event belongs

Some prescriptions and laboratory results are logged before their admission formally starts. A date-only filter can therefore include events from the very admission that establishes the label.

Index-admission event excluded
Observation window

Earlier patient history

Index admission

Label established

Prescription recorded

Earlier timestamp
Same index-admission ID

Excluded

The admission ID resolves the ambiguity

Every event belonging to the index admission is removed, even when its timestamp falls before that admission's recorded start. The same rule is applied to prescriptions, laboratory results, and admission sequences.

Schematic timing, not a patient record. Source: the dissertation's data-leakage investigation.

Exclusion by admission identity

Matching the index admission by hadm_id removes its events regardless of their timestamps. Rerunning the full pipeline afterwards moved AUROC by less than 0.01 for every model and lowered AUPRC by 0.02 to 0.05.

A remaining preprocessing limitation

Diagnosis and medication selection thresholds are fitted on training data. The laboratory missingness cutoff uses the full window cohort. This preprocessing asymmetry remains a limitation of the evaluation.

Neo4j / clinical graph

A connected record
of each admission

The graph database preserves patients, admissions, and the clinical entities attached to each stay. Its role is distinct from the similarity graph used for the primary GraphSAGE comparison.

HAS_ADMISSIONNEXTHAS_DRUGHAS_CONDITIONHAS_OUTCOMEHAS_OBSERVATIONPatientAdmissionDrugConditionOutcomeObservation
Reduced motion enabled. Explore the diagram using the node selectors.

Six node types

Admission

The centre of each hospital stay. It links to the conditions, drugs, observations, and outcome recorded for that admission. NEXT connects successive admissions for the same patient.

The schema describes node types. The NEXT loop means one admission connects to the next admission for that patient. Source: Figure 3.7 and Section 3.4.2.

Patient journey / Neo4j

How the clinical record connects

Neo4j stores the admission chain and the clinical entities attached to each stay. This heterogeneous graph supported structural exploration and the supplementary HashGNN experiment.

Patient similarity / GraphSAGE

How patients resemble each other

The primary GraphSAGE model uses a separate graph connecting each patient to three neighbours in feature space. It does not train on the Neo4j admission chain.

Explore the native Neo4j results

HashGNN on the patient-journey graph

HashGNN generates embeddings from the heterogeneous graph. XGBoost and Random Forest then classify those embeddings.

These exploratory runs use generated starting features and a smaller sequence-eligible population. They are not directly comparable with the primary GraphSAGE results.

Table 4.5 / exploratory HashGNN results
ModelAUROCAUPRCF1PrecisionRecall
XGBoost / 12m0.63220.67030.69290.64830.7441
Random Forest / 12m0.62650.67060.62380.64770.6016
XGBoost / 18m0.67800.72480.66590.66590.6659
Random Forest / 18m0.68480.71350.66290.69250.6358

Core results

Tree-based models
led on AUROC

XGBoost has the highest AUROC at twelve months. Random Forest leads at eighteen months by 0.0001. Most full-cohort models finish close together.

Evaluation / Section 3.6.1

A held-out test of each representation

Each full matched cohort is split by heart failure label and gender. Model selection uses validation AUROC; reported results come from the test split.

70%Training15%Validation15%Test
Full matched cohorts / Table 3.5. The GRU uses a smaller sequence-eligible subset.
WindowTrainingValidationTest
12 months6,5591,4061,406
18 months8,0471,7241,725
A closer look at the modelling choices

Selection before evaluation

The study uses a random seed of 42 and selects model settings using validation AUROC. Precision, recall and F1 describe the fixed 0.5 threshold; probability calibration was outside scope.

Additional graph experiments

Node2Vec learns embeddings from graph walks. Random projection provides a simpler comparison. GraphSAGE embeddings were also passed to XGBoost and Random Forest. These supplementary pipelines are separate from the end-to-end GraphSAGE model in the eight-model comparison.

Sources: Sections 3.4.3, 3.5, 3.6.1 and 4.4. Native Neo4j HashGNN results are discussed in Graph research.

AUROC

How well the model ranks heart failure cases above controls across classification thresholds.

Across classification thresholds / Section 3.6.1

Higher values indicate better performance on this measure. The highlight marks the highest reported value for AUROC. Populations differ. The axis runs from 0 to 1.

The GRU uses a smaller, sequence-eligible population with a different heart failure prevalence. Its scores are not a controlled comparison with the other seven models; both AUROC and AUPRC need that context.

View the five main metrics
Core model results, 12 months. Dissertation Table 4.6.
ModelAUROCAUPRCF1PrecisionRecall
Logistic Regression0.94590.85370.78350.70700.8786
MLP0.94620.82570.78360.76120.8074
SVM0.94120.79790.79420.69220.9314
Random Forest0.94990.81750.79620.71910.8918
XGBoost0.95450.85360.81110.77590.8496
FT-Transformer0.94350.82850.78640.70820.8839
GRU (sequence subset)0.80870.78930.83030.77270.8971
GraphSAGE0.94520.83560.78170.66670.9446
Specificity, accuracy and classification error

Threshold 0.5. Classification error is the only measure here where lower is better. Tables 4.10 and 4.11 report these measures for the full XGBoost and GRU models. Other models are marked as not reported in these tables.

Additional reported measures / 12m
ModelSpecificityAccuracyClassification error
Logistic RegressionNot reportedNot reportedNot reported
MLPNot reportedNot reportedNot reported
SVMNot reportedNot reportedNot reported
Random ForestNot reportedNot reportedNot reported
XGBoost0.90940.89330.1067
FT-TransformerNot reportedNot reportedNot reported
GRU (sequence subset)0.64160.78880.2112
GraphSAGENot reportedNot reportedNot reported

One threshold, different tradeoffs

Finding cases, limiting false positives

These are the reported precision and recall at a threshold of 0.5. Each point is one model, not a precision–recall curve.

XGBoost
Precision
0.7759
Recall
0.8496
F1
0.8111

Full matched cohort. Higher recall can come with lower precision.

000.250.250.50.50.750.7511Recall →Precision →
Axes 0–1. Hollow amber point: GRU subset. Exact values appear in the main table. Source: Table 4.6.

GraphSAGE finds more labelled cases

Its reported recall is 0.9446 at twelve months and 0.9461 at eighteen months, the highest among the core models. Higher recall comes with a precision tradeoff at the study's fixed threshold.

More structure did not lead to a clear gain

The strongest aggregated models retained their lead in AUROC. These are descriptive differences from held-out splits; the study does not establish statistical significance or generalisation to another centre.

Medication ablation

The GRU depends more on medication history at eighteen months

Removing every medication-derived feature produces a modest loss for XGBoost. The eighteen-month GRU drops from 0.8450 to 0.6390 AUROC.

How well the model ranks heart failure cases above controls across classification thresholds. Across classification thresholds.

XGBoost

With medications0.9524
Without medications0.9435
Change in AUROC−0.0089
00.51

GRU

With medications0.8450
Without medications0.6390
Change in AUROC−0.2060
00.51
All eight ablation measures
Medication ablation / Table 4.11
ModelAUROCAUPRCF1PrecisionRecallSpecificityAccuracyClassification error
XGBoost / with medications0.95240.83610.81210.78740.83840.91670.89570.1043
XGBoost / without medications0.94350.80490.77860.77280.78450.91510.88000.1200
GRU / with medications0.84500.81990.84150.75910.94400.63230.80400.1960
GRU / without medications0.63900.67500.52370.54980.50000.49740.49880.5012
Both models were retrained without medication-derived features. Filled markers show the full feature set; hollow markers show the ablation. Change = without minus with. Source: Table 4.11.

Interpretability

Different inputs,
different priorities

XGBoost's leading features are mostly medication-related. The GRU gives more weight to laboratory measurements and gender. Polypharmacy count appears near the top in both.

Top ten features / reported order

XGBoost

TreeSHAP

GRU

GradientSHAP

Distinct drugs prescribed: rank 2 in XGBoost; rank 1 in the GRU.

Dissertation Table 4.8. Positions show rank by mean absolute SHAP value, not the size or direction of an effect. Magnitudes from the two explanation methods should not be compared directly.

Feature importance is model-specific

SHAP describes what a trained model used. A high rank does not establish a causal relationship or make a feature a treatment target.

Attention needs a different reading

The FT-Transformer's attention weights were close to uniform and agreed weakly with the SHAP rankings. They are not presented here as equivalent feature explanations.

Limitations

Where the evidence ends

The results are useful only with their study conditions in view. These boundaries apply to every chart on this page.

One centre, no external validation

All results come from held-out splits of one academic medical centre's data. Performance in another hospital or population has not been established.

Different model populations

The GRU requires usable in-window admission sequences. HashGNN also uses a smaller sequence-eligible population and different starting features. Their scores cannot be treated as like-for-like alternatives to the full-cohort models.

A fixed, uncalibrated threshold

Classification uses a 0.5 threshold. Calibration and threshold selection for clinical use were outside the study, and performance differences were not significance-tested.

Sequence and graph remain separate

The study did not combine temporal and relational modelling. A temporal graph approach would require a separate investigation.

Retrospective classification

These experiments classify heart failure labels within the study design. They do not demonstrate prospective clinical benefit or support care decisions for an individual.

Next research steps

Test beyond this cohort

External validation would test whether these results hold in another hospital. Calibration would examine how well predicted probabilities agree with observed outcomes and whether the 0.5 threshold is appropriate.

A relationship-aware temporal graph is a further direction: learning from the admission sequence and clinical connections together. This was proposed, not implemented, in the study.

Source: Section 5.5.

Model lab

Change the inputs
Inspect the prediction

An XGBoost model runs locally in your browser on synthetic patients. Explore its predictions and the original patient's SHAP explanation.

Open the model lab