[Contribution] GraphCare: KG-enhanced EHR predictions (ICLR 2024)#882
[Contribution] GraphCare: KG-enhanced EHR predictions (ICLR 2024)#882jhnwu3 merged 1 commit intosunlabuiuc:masterfrom
Conversation
jhnwu3
left a comment
There was a problem hiding this comment.
Is there a way to make an example script using mortality prediction as an example?
Not sure if that's easy, let me know.
a2d40c0 to
839af35
Compare
|
@jhnwu3: |
jhnwu3
left a comment
There was a problem hiding this comment.
Lgtm, actually I was thinking of saying we could probably redefine the MIMIC3 or MIMIC4 task to have a swappable input_schema, but this example actually highlights a nice flexibility of PyHealth I hadn't even considered before. That's really cool!
Contributor Information
Description
Adds GraphCare (Jiang et al., ICLR 2024) as a native PyHealth model. GraphCare uses personalized knowledge graphs with a GNN backbone for healthcare prediction tasks.
Paper: [GraphCare: Enhancing Healthcare Predictions with Personalized Knowledge Graphs](https://openreview.net/forum?id=tVTN7Zs0ml)
Original repo: [pat-jj/GraphCare](https://github.com/pat-jj/GraphCare)
This PR builds directly on the
pyhealth.graphinfrastructure from #853, proving it works end-to-end with a real model.What's included:
pyhealth.models.GraphCare— Full model inheritingBaseModel:joint,graph,nodeforward()returning{loss, y_prob, y_true, logit}pyhealth.models._graphcare.BiAttentionGNNConv— BAT GNN layer:Usage
Design decisions:
pyhealth.graph.KnowledgeGraphandGraphProcessorfrom [Contribution] pyhealth.graph: Native knowledge graph support + GraphProcessor #853 — no custom KG builder or DataLoader neededtorch-geometricremains optional — all imports guarded withtry/exceptkg_builder.py(superseded bypyhealth.graph)Files to Review
New files:
pyhealth/models/graphcare.py— main modeltests/core/test_graphcare.py— 22 unit tests (BAT, GAT, GIN × 3 modes)docs/api/models/pyhealth.models.GraphCare.rst— API docsModified files:
pyhealth/models/_graphcare/__init__.py— removed kg_builder importpyhealth/models/_graphcare/bat_gnn.py— optional PyG imports, string-quoted annotationspyhealth/models/__init__.py— added GraphCare exportdocs/api/models.rst— added to toctreeDeleted files:
pyhealth/models/_graphcare/kg_builder.py— superseded bypyhealth.graph.KnowledgeGraphTesting
python -m unittest tests.core.test_graphcare -v # 22 tests (skip gracefully if torch-geometric not installed)Dependencies
torch-geometric(optional, same as [Contribution] pyhealth.graph: Native knowledge graph support + GraphProcessor #853)pyhealth.graphmodule ([Contribution] pyhealth.graph: Native knowledge graph support + GraphProcessor #853, already on master)