Add InHospitalMortalityTemporalMIMIC4 task for EMDOT temporal evaluation#1025
Open
nskath wants to merge 18 commits intosunlabuiuc:masterfrom
Open
Add InHospitalMortalityTemporalMIMIC4 task for EMDOT temporal evaluation#1025nskath wants to merge 18 commits intosunlabuiuc:masterfrom
nskath wants to merge 18 commits intosunlabuiuc:masterfrom
Conversation
- Replace docstring-only example with full runnable ablation script covering all-historical vs sliding-window regimes, window size ablation (w=1,2,3,5), and LR/GBDT/MLP model comparison - Add test suite using synthetic mimic4demo data covering schema validation, label generation, feature extraction, and edge cases (minors excluded, admissions with missing features skipped)
Remove GBDT and MLP model variants from the ablation script to match the project scope (LR baseline, extensible to other models later).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributors
Type of Contribution
Standalone Task (Option 3)
Original Paper
Zhou, H.; Chen, Y.; and Lipton, Z. C. 2023. Evaluating Model Performance in Medical Datasets Over Time. CHIL 2023. PMLR 209:498-508.
High-Level Description
This PR adds
InHospitalMortalityTemporalMIMIC4, a standalone task that tags each admission sample with its real (de-shifted) calendar year so that callers can partition data chronologically using the EMDOT framework.The EMDOT paper shows that standard random train/test splits overestimate model performance by ignoring temporal distribution shift in clinical data. This task enables reproducing that finding on MIMIC-IV by:
hospital_expire_flaganchor_yearandanchor_year_groupto recover real calendar yearsadmission_yearfieldThe ablation script demonstrates that random splits yield ~0.986 AUROC while temporal splits starting from 2012 yield ~0.937, confirming the paper's core finding. Window size ablation (w=1,2,3,5) shows the recency vs sample-size tradeoff.
File Guide
pyhealth/tasks/in_hospital_mortality_temporal_mimic4.pypyhealth/tasks/__init__.pyInHospitalMortalityTemporalMIMIC4importtests/core/test_mimic4_mortality_temporal.pyexamples/mortality_prediction/mortality_mimic4_temporal_emdot.pydocs/api/tasks/pyhealth.tasks.InHospitalMortalityTemporalMIMIC4.rstdocs/api/tasks.rst