Add MedFuse model + MIMIC-IV EHR/CXR mortality task + runner - #44
Open
joshuxchn wants to merge 1 commit into
Open
Add MedFuse model + MIMIC-IV EHR/CXR mortality task + runner#44joshuxchn wants to merge 1 commit into
joshuxchn wants to merge 1 commit into
Conversation
Ports the MedFuse model (pyhealth/models/medfuse.py) into the fork (it lived only on upstream) and adds MedFuseMortalityMIMIC4: a real MIMIC-IV + MIMIC-CXR in-hospital mortality task that emits ehr/cxr/cxr_mask consumed by MedFuse. EHR selectable between ICU vitals (chartevents) and chemistry labs (labevents); plus an example runner. Exports added to tasks/ and models/ __init__. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Original medfuse runs on synthetic sample dataset. This PR connects it to mimic.
Adds
pyhealth/tasks/medfuse_mortality.py—MedFuseMortalityMIMIC4: one sample per paired ICU stay →{ehr, cxr, cxr_mask, mortality}.--ehr-sourcevitals (chartevents) | labs (labevents), fixed 48h/2h window.examples/mortality_prediction/medfuse_mimic4.py— script, arguments:--ehr-source {vitals,labs},--modality {ehr_cxr,ehr_only}, wandb logging, configs embedded .pyhealth/tasks/__init__.py.Run:
python examples/mortality_prediction/medfuse_mimic4.py --ehr-source vitals --modality ehr_cxr(Will post run results once they finish)