Skip to content

Commit 44f119b

Browse files
committed
Add the Rotterdam MENSA example and experiments E1-E4
1 parent 5213360 commit 44f119b

2 files changed

Lines changed: 3308 additions & 0 deletions

File tree

‎docs/api/models/pyhealth.models.MENSA.rst‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,29 @@ Usage
8282
times = torch.linspace(0, 7000, 50) # days
8383
curves = model.predict_survival(batch["features"], times) # [N, 2, 50]
8484
85+
Example and results
86+
-------------------
87+
88+
``examples/rotterdam_multi_event_survival_mensa.py`` reproduces the paper's
89+
Rotterdam protocol: the authors' stratified 70/10/20 split, CoxPH and
90+
DeepSurv baselines, and global/local C-index, AUC, IBS, MAE and
91+
D-calibration. It also runs a learning curve (E2) and ablations (E3, E4).
92+
To run the whole pipeline on synthetic data (no download)::
93+
94+
python examples/rotterdam_multi_event_survival_mensa.py --synthetic
95+
96+
With the real CSV in ``../data``::
97+
98+
python examples/rotterdam_multi_event_survival_mensa.py --data-root ../data \
99+
--experiment main --seeds 0-9 --output-dir ../runs/e1
100+
101+
Over seeds 0-9, MENSA reaches a global C-index of 69.3 and a local C-index of
102+
90.9 (x100; paper 69.4 and 90.1). Most of the local C-index comes from the
103+
event order: predicting recurrence before death for every patient, with no
104+
model, gives 91.0. MENSA equals that on 8 of 10 seeds and is below it on 2.
105+
This reference is not an upper bound. The example's module docstring records
106+
all results, including why the default IBS varies widely across splits.
107+
85108
API reference
86109
-------------
87110

0 commit comments

Comments
 (0)