PyHealth
PyHealth copied to clipboard
[Bounty] Update Dr. Agent model (PyHealth 2.0)
Contributor
- Name: Joshua Steier
Contribution Type
Model
Description
Implements the Dr. Agent model from "Dr. Agent: Clinical predictive model via mimicked second opinions" (JAMIA 2020).
Key features:
- Dual-agent reinforcement learning with dynamic skip connections
- Primary agent (current visit) + second-opinion agent (historical context)
- Support for static demographic features
- GRU/LSTM cell options
- REINFORCE with optional baseline for variance reduction
Paper: https://doi.org/10.1093/jamia/ocaa074
Files to Review
| File | Description |
|---|---|
pyhealth/models/agent.py |
Model implementation (AgentLayer + Agent) |
tests/test_agent.py |
Unit tests |
examples/agent_mimic4.ipynb |
Example notebook with MIMIC-IV |
How to Test
# Run unit tests
python -m pytest tests/test_agent.py -v
# Or run the model directly
python pyhealth/models/agent.py
Checklist
- [x] Code follows PEP8 (88-char line limit)
- [x] Google-style docstrings with type hints
- [x] Inherits from BaseModel (v2.0 style)
- [x] Unit tests provided
- [x] Example notebook provided
- [x] Rebased with main branch