Scalable Clinical Data Infrastructure and Comparative ML Evaluation for Hospitalisation Risk Prediction in Elderly Patients with Multiple Long-Term Conditions using CPRD
Authors: Asra Aslam, Volodymyr Chapman, Maurice M. O'Connell, Aseel S. Abuzour, Michael Abaho, Danushka Bollegala, Gary Leeming, Eduard Shantsila, +4 more
Organizations: School of Information, University of Sheffield, Sheffield, United Kingdom · School of Medicine, Faculty of Medicine and Health, University of Leeds, Leeds, United Kingdom · Division of Informatics, University of Manchester, Manchester, United Kingdom · Academic Unit for Ageing & Stroke Research, University of Leeds, Leeds, United Kingdom · Institute of Population Health, University of Liverpool, Liverpool, United Kingdom
Deep learning architectures are increasingly proposed for patient trajectory modeling in electronic health records (EHRs), yet their advantage over simpler, more interpretable models is rarely subjected to rigorous empirical scrutiny in real-world clinical settings. We present a comprehensive patient timeline pipeline applied to elderly patients in CPRD Aurum, incorporating 260 clinical conditions classified via a three-tier automated framework including specialised detection logic for 17 complex conditions. Using this infrastructure, we benchmark Temporal Graph Convolutional Neural Networks (TG-CNN) against Logistic Regression with LASSO regularisation and Random Forests for predicting 12-month all-cause emergency hospitalisation risk, motivated by (but not filtered to) the elevated risk of adverse drug reactions. Under cross-validation, TG-CNN achieves a marginally higher mean AUC-ROC than LASSO (0.712 vs. 0.705), whereas on the held-out test set LASSO achieves the highest discrimination of three models (AUC-ROC 0.733, versus 0.710 for Random Forest and 0.702 for TG-CNN). We show, that discrimination alone is an incomplete criterion for clinical deployment: after Platt calibration, LASSO is the only model with an acceptable calibration slope (0.817), while Random Forest (0.759) and, TG-CNN (0.391) remain substantially miscalibrated. We argue that LASSO, not the highest-discriminating model, is the model best suited to direct clinical deployment. We present lessons for the machine learning and healthcare community regarding data infrastructure, model selection, and value of calibration and interpretability in high-stakes decision support.
Figures & tables
Figure 1: CPRD Data Preprocessing Workflow Architecture.
Condition
Primary Data Source
Threshold / Criterion
Guideline
Hypertension
ABPM / in-office BP
SBP ≥ 140 or DBP ≥ 90 mmHg ( ≥ 3 readings)
NICE NG136
Hypotension
ABPM / cuff BP
SBP ≤ 90 or DBP ≤ 60 mmHg ( ≥ 3 readings)
Clinical consensus
Anaemia (Other)
Haemoglobin (Hb)
F: < 11.5 g/dL; M: < 13.0 g/dL
WHO
Osteoporosis
BMD T-score (DEXA)
T-score <− 2.5
WHO
Cholesterol
HDL/LDL/Total/TG
Elevated in any component; gender-specific HDL
NICE CG181
CKD
eGFR
eGFR < 60 mL/min/1.73m 2 (staged 3a–5)
KDIGO 2012
Table 1: Detection logic for the 17 complex conditions (abbreviations here * ).
Characteristic
Value
Total patients (training set)
570,125
Total patients (test set)
63,347
Age criterion
≥ 65 years at 01 April 2019
Observation window
01 April 2019 to 31 March 2020
Outcome: all-cause hospitalisation (training)
∼ 20% (class imbalance present)
Clinical conditions modelled
Simple, Intermediate, Complex tiers)
Table 2: Cohort and pipeline summary. Exact class distribution is reflected in the stratified sampling strategy described in Section 3.4 .
5-fold Cross-Validation
Model
Data
Mean
Standard
AUC-ROC
Deviation
Logistic Regression
Demographics
0.640
0.0013
(LASSO)
Events
0.688
0.0056
Demographics + events
0.705
0.0041
Random Forest
Demographics
0.643
0.0024
Table 3: Model performance summary: mean validation AUC-ROC and standard deviation under 5-fold cross-validation. All models predict all-cause hospitalisation within 12 months in an elderly primary care cohort ( Ntrain=570,125 ).
Model
C-slope
Brier score
ECE
AUC-ROC
AUC-PR
( ↑ 1.0 best)
( ↓ best)
( ↓ best)
( ↑ best)
( ↑ best)
LASSO
0.817
0.132
0.013
0.733
0.380
Random Forest
0.759
0.135
0.009
0.710
0.333
TG-CNN
0.391
0.137
0.008
0.702
0.334
Table 4: Model performance comparison across metrics on test set ( Ntest=63,347 ).
Figure 2: Diagnostics for (a) LASSO (b) Random Forest, and (c) TGCNN models with Calibration plots (on left) showing predicted versus observed hospitalisation rates; the curve falls below the ideal diagonal indicating systematic overestimation of risk. And GP-stratified C-statistic plots (right) showing performance across primary care practices; red points indicate practices outside the confidence envelope.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 3: TG-CNN Architecture with Dual Layer based Configuration flexibility
Figure 4: TGCNN Training for Demographics, Events, and Events with Demographics. Dashed vertical lines indicate the early stopping epoch (Epoch 1) where validation loss reached its minimum and model weights were saved for testing
Model
Best AUC-ROC
Calibration
Interpretable
Deployable without post-hoc correction?
LASSO
0.733
Well-calibrated
Yes (548 coefficients)
Yes
Random Forest
0.710
Miscalibrated
Partial
No
TG-CNN
0.702
Miscalibrated
No (black box)
No
Appendix
Table 5: Multi-criteria Model Summary.
Feature Category
Count
Description / Encoding
Clinical Conditions
190
Unique condition codes observed in the elderly cohort (DynAIRx framework)
Medication Prescriptions
802
Unique British National Formulary (BNF) prescription codes
Demographics
19
18 binary encodings plus continuous scaled age
Appendix
Table 6: Consolidated Feature Inventory Across Model Input Categories
Figure 5: Calibration curves for Logistic Regression (LASSO), Random Forest, and TG-CNN models on the test set, comparing raw predictions against post-hoc Platt scaling and Isotonic regression.
Figure 6: Change in TG-CNN test-set performance and calibration metrics when event order is shuffled, relative to the unshuffled baseline (dashed red line at zero), across 50 independent shuffles. (a) Absolute value of the change in each metric. (b) Raw change in each metric, showing whether shuffling increased or decreased each value.
Figure 7: Permutation feature importance for LASSO (top predictors: primary care prescription codes, BNF, and functional status markers, event_Housebound) and Random Forest (which additionally ranks individual chronic conditions, including dementia and atrial fibrillation, among its top predictors), ranked by mean MSE increase upon feature permutation on the held-out test set.
Figure 8: SHAP values for LASSO and Random Forest on the held-out test set, showing age as the dominant predictor for both models, followed by medication-related and functional status features consistent with the permutation importance results.
Category
Parameter
Values tested
Best model
Learning process
Max epochs
10
1 *
Initial learning rate
{10−2,10−3}
10−3
Learning rate decay
Exponential ( γ=0.9
Same
decay every 106 steps)
Optimizer
Adam
Adam
Batch size
64
64
Appendix
Table 7: Hyperparameter search space with selected hyperparameters for the final model.
Research Unit of Intelligent Health Technologies, Universit`a Campus Bio-Medico di Roma, Rome, Italy. · Central Diagnostic Laboratory, University Medical Center Utrecht, Utrecht, The Netherlands.
Department of Computer Engineering, SRC.,Islamic Azad university, Tehran, Iran · School of Computer Engineering, Iran university of Science and technology, Tehran, Iran