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.
Heart failure research / MIMIC-IV
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.

12-month leader XGBoost
0.954518-month leader Random Forest
0.9525The question
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.
Does an admission sequence or patient-similarity graph outperform an aggregated feature vector?
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
Each representation retains a different part of the clinical record. Select a view to see what the model receives.
History summarised
Diagnosis flags, medication counts, and laboratory summaries become one vector. It preserves what happened within the window, but not the order of admissions.
Logistic Regression, MLP, SVM, Random Forest, XGBoost, FT-Transformer
Order preserved
Each admission retains its own features. The GRU reads the sequence from oldest to newest, with gender and polypharmacy count supplied alongside. Only patients with usable in-window sequences enter this comparison.
GRU
Connections
Patients are connected to their three nearest neighbours in the shared feature space. GraphSAGE combines each patient's own features with information from those neighbours.
GraphSAGE
Cohort construction
Cases and controls are matched by gender and ten-year age band. Features exclude admissions on or after each patient's index date.
12 months
18 months
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
Both windows use the same aggregated schema. Diagnosis flags form most of the vector; medications and laboratory measurements add a different kind of history.
Three-character diagnosis roots retained by the study's feature-selection rule.
Data leakage
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.
Earlier patient history
Label established
Earlier timestamp
Same index-admission ID
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.
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.
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
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.
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
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
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.
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.
| Model | AUROC | AUPRC | F1 | Precision | Recall |
|---|---|---|---|---|---|
| XGBoost / 12m | 0.6322 | 0.6703 | 0.6929 | 0.6483 | 0.7441 |
| Random Forest / 12m | 0.6265 | 0.6706 | 0.6238 | 0.6477 | 0.6016 |
| XGBoost / 18m | 0.6780 | 0.7248 | 0.6659 | 0.6659 | 0.6659 |
| Random Forest / 18m | 0.6848 | 0.7135 | 0.6629 | 0.6925 | 0.6358 |
Core results
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
Each full matched cohort is split by heart failure label and gender. Model selection uses validation AUROC; reported results come from the test split.
| Window | Training | Validation | Test |
|---|---|---|---|
| 12 months | 6,559 | 1,406 | 1,406 |
| 18 months | 8,047 | 1,724 | 1,725 |
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.
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.
How well the model ranks heart failure cases above controls across classification thresholds.
Across classification thresholds / Section 3.6.1Higher 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.
| Model | AUROC | AUPRC | F1 | Precision | Recall |
|---|---|---|---|---|---|
| Logistic Regression | 0.9459 | 0.8537 | 0.7835 | 0.7070 | 0.8786 |
| MLP | 0.9462 | 0.8257 | 0.7836 | 0.7612 | 0.8074 |
| SVM | 0.9412 | 0.7979 | 0.7942 | 0.6922 | 0.9314 |
| Random Forest | 0.9499 | 0.8175 | 0.7962 | 0.7191 | 0.8918 |
| XGBoost | 0.9545 | 0.8536 | 0.8111 | 0.7759 | 0.8496 |
| FT-Transformer | 0.9435 | 0.8285 | 0.7864 | 0.7082 | 0.8839 |
| GRU (sequence subset) | 0.8087 | 0.7893 | 0.8303 | 0.7727 | 0.8971 |
| GraphSAGE | 0.9452 | 0.8356 | 0.7817 | 0.6667 | 0.9446 |
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.
| Model | Specificity | Accuracy | Classification error |
|---|---|---|---|
| Logistic Regression | Not reported | Not reported | Not reported |
| MLP | Not reported | Not reported | Not reported |
| SVM | Not reported | Not reported | Not reported |
| Random Forest | Not reported | Not reported | Not reported |
| XGBoost | 0.9094 | 0.8933 | 0.1067 |
| FT-Transformer | Not reported | Not reported | Not reported |
| GRU (sequence subset) | 0.6416 | 0.7888 | 0.2112 |
| GraphSAGE | Not reported | Not reported | Not reported |
One threshold, different tradeoffs
These are the reported precision and recall at a threshold of 0.5. Each point is one model, not a precision–recall curve.
Full matched cohort. Higher recall can come with lower precision.
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.
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
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.
| Model | AUROC | AUPRC | F1 | Precision | Recall | Specificity | Accuracy | Classification error |
|---|---|---|---|---|---|---|---|---|
| XGBoost / with medications | 0.9524 | 0.8361 | 0.8121 | 0.7874 | 0.8384 | 0.9167 | 0.8957 | 0.1043 |
| XGBoost / without medications | 0.9435 | 0.8049 | 0.7786 | 0.7728 | 0.7845 | 0.9151 | 0.8800 | 0.1200 |
| GRU / with medications | 0.8450 | 0.8199 | 0.8415 | 0.7591 | 0.9440 | 0.6323 | 0.8040 | 0.1960 |
| GRU / without medications | 0.6390 | 0.6750 | 0.5237 | 0.5498 | 0.5000 | 0.4974 | 0.4988 | 0.5012 |
Interpretability
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
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.
SHAP describes what a trained model used. A high rank does not establish a causal relationship or make a feature a treatment target.
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
The results are useful only with their study conditions in view. These boundaries apply to every chart on this page.
All results come from held-out splits of one academic medical centre's data. Performance in another hospital or population has not been established.
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.
Classification uses a 0.5 threshold. Calibration and threshold selection for clinical use were outside the study, and performance differences were not significance-tested.
The study did not combine temporal and relational modelling. A temporal graph approach would require a separate investigation.
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
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
An XGBoost model runs locally in your browser on synthetic patients. Explore its predictions and the original patient's SHAP explanation.