Add SHy Model and MIMIC III Diagnosis Task#1109
Open
JudyTi wants to merge 5 commits intosunlabuiuc:masterfrom
Open
Add SHy Model and MIMIC III Diagnosis Task#1109JudyTi wants to merge 5 commits intosunlabuiuc:masterfrom
JudyTi wants to merge 5 commits intosunlabuiuc:masterfrom
Conversation
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.
Contributor name
Judy Tian
NetID/email
judyt2@illinois.edu
Type of contribution
Option 4: model + task
Link to original paper
Yu, Leisheng, et al. "Self-Explaining Hypergraph Neural Networks for Diagnosis Prediction." ArXiv.org, 2025, arxiv.org/abs/2502.10689.
High-level description of implementation
Model
This PR adds the SHy (Self-Explaining Hypergraph) model, a novel neural network architecture for patient diagnosis prediction that models medical data as a hypergraph. The implementation is designed to capture the complex, multi-relational structure of healthcare data where a single medical event can involve multiple clinical concepts (i.e. previous hospital visit with several diagnoses). It mainly contains the HierarchicalEmbedding module, the UniGINConv hypergraph convolution (idea from paper and cite 1), and the main SHy model.
Files
pyhealth/models/shy.pytests/core/test_shy.pypyhealth/models/__init__.pydocs/api/models.rstdocs/api/models/pyhealth.models.SHy.rstTask
This PR also adds a new MIMIC-III Task alongside the model: DiagnosisPredictionMIMIC3 task. This task transforms raw MIMIC-III data into a sequence-to-sequence format for diagnosis prediction, where the input is a sequence of past visits (i.e. each a list of diagnosis codes) and the label is the set of diagnosis codes in the next visit.
Files
pyhealth/tasks/diagnosis_prediction_mimic3.pytests/core/test_mimic3_diagnosis_prediction.pypyhealth/tasks/__init__.pydocs/api/tasks.rstdocs/api/tasks/pyhealth.tasks.diagnosis_prediction_mimic3.rstOther
Example file is also added to work as a demo to show end-to-end workflow and use several different statistics metrics to test model accuracy.
Files
examples/mimic3_diagnosis_shy.pyCite:
Demo data from
File guide listing which files to review
pyhealth/models/shy.pytests/core/test_shy.pypyhealth/models/__init__.pydocs/api/models.rstdocs/api/models/pyhealth.models.SHy.rstpyhealth/tasks/diagnosis_prediction_mimic3.pytests/core/test_mimic3_diagnosis_prediction.pypyhealth/tasks/__init__.pydocs/api/tasks.rstdocs/api/tasks/pyhealth.tasks.diagnosis_prediction_mimic3.rstexamples/mimic3_diagnosis_shy.pyTest result