Skip to content

Add Shy Model for personalized diagnosis prediction#1042

Open
yli302 wants to merge 2 commits intosunlabuiuc:masterfrom
yli302:master
Open

Add Shy Model for personalized diagnosis prediction#1042
yli302 wants to merge 2 commits intosunlabuiuc:masterfrom
yli302:master

Conversation

@yli302
Copy link
Copy Markdown

@yli302 yli302 commented Apr 20, 2026

Contributor

Type of Contribution

  • Option 2: Model

Link to Original Paper

  • https://arxiv.org/abs/2502.10689
  • Yu, L., Cai, Y., Zhang, M., & Hu, X. (2025). Self-Explaining Hypergraph Neural Networks for Diagnosis Prediction. arXiv preprint arXiv:2502.10689.

Description of Implementation

This Pull Request implements SHy (Self-Explaining Hypergraph Neural Networks), an inherently interpretable model for diagnosis prediction that represents longitudinal Electronic Health Records (EHR) as patient-specific hypergraphs. The implementation is modularized into specialized classes and utility functions to align with PyHealth’s architecture.

It uses a GRU and self-attention mechanism to process the extracted phenotypes into a final diagnosis prediction. This structure allows clinicians to directly intervene by editing the generated phenotypes to refine the model's output.

File List

The following files should be reviewed for this contribution.

Core Implementation Files Description
pyhealth/models/__init__.py Exposes the SHy class within the pyhealth.models module to allow for standardized importing across the library
pyhealth/models/shy.py The main implementation file containing the core logic: SHy class, Inherits from BaseModel; HypergraphMessagePassing class, Implements the UniGIN mechanism; PhenotypeMiner class, Implements the Gumbel-Softmax to extract discrete
Documentation RST files Description
docs/api/models.rst Exposes the SHy class within the pyhealth.models module to allow for standardized importing across the library
docs/api/models/pyhealth.models.SHy.rst The RST documentation file for the SHy
Tests file Description
tests/core/test_shy.py Unit tests that uses minimal synthetic tensors to verify model instantiation, forward pass logic, output shapes, and gradient computation

yli302 added 2 commits April 20, 2026 11:16
Add Shy Model for personalized diagnosis prediction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant