Open-Source Healthcare AI
A Python toolkit for clinical deep learning — unifying datasets, tasks, and models across electronic health records, physiological signals, and medical imaging.
Datasets
Tasks
Models
Members
Researchers
pandas
pandarallel
5-Stage Pipeline in <15 Lines
The same pattern works for any task — swap the dataset and task class to move between mortality, readmission, drug recommendation, or imaging.
Mortality prediction on MIMIC-III
from pyhealth.datasets import MIMIC3Dataset from pyhealth.tasks import MortalityPredictionMIMIC3 from pyhealth.datasets import split_by_patient, get_dataloader from pyhealth.models import Transformer from pyhealth.trainer import Trainer if __name__ == "__main__": # 1. Load data dataset = MIMIC3Dataset(root="data/", tables=["DIAGNOSES_ICD", "PROCEDURES_ICD"]) samples = dataset.set_task(MortalityPredictionMIMIC3()) # 2. Split & load train_ds, val_ds, test_ds = split_by_patient(samples, [0.8, 0.1, 0.1]) train_loader = get_dataloader(train_ds, batch_size=32, shuffle=True) # 3. Train model = Transformer(dataset=samples) trainer = Trainer(model=model) trainer.train(train_loader, val_loader, epochs=50, monitor="pr_auc") trainer.evaluate(test_loader)
Built for Scale — Efficient by Design
Benchmarked on MIMIC-IV at 4 parallel workers. PyHealth 2.0 uses a memory-mapped architecture that dynamically adapts to your hardware — whether you have 2 cores or 64, it scales without manual memory management so you can focus on the ML, not the infrastructure. Pandas values shown at 1 worker only (†) as it could not scale beyond single-threaded execution.
Drug Recommendation
Wall Time (hours · lower is better)
Peak Memory (GB · lower is better)
Length of Stay Prediction
Wall Time (hours · lower is better)
Peak Memory (GB · lower is better)
In-Hospital Mortality
Wall Time (hours · lower is better)
Peak Memory (GB · lower is better)
† Pandas measured at 1 worker; failed beyond single-threaded execution. All other methods at 4 workers on MIMIC-IV. Full benchmark in the PyHealth 2.0 paper.
How PyHealth Standardizes Clinical AI Development
A unified API from raw clinical data to trustworthy, interpretable models — follow the pipeline step by step.
Data Foundation
Core patient and clinical event data structures.
Loaders for MIMIC-III/IV, eICU, OMOP, and 17+ more.
Standardized clinical prediction task definitions.
Modeling Pipeline
Feature extraction, encoding, and transformation.
33+ clinical ML models across EHR, signals, and imaging.
Unified training loop with checkpointing and early stopping.
Evaluation & Trust
Clinical evaluation metrics and benchmarking utilities.
Explainability methods for transparent clinical AI.
Conformal prediction for rigorous uncertainty quantification.
Resources
Everything you need to get started or get involved.
Documentation
Full API reference, tutorials, quickstart guides, and worked examples for all supported tasks.
Read the docsGitHub Repository
Browse the source code, open issues, submit pull requests, and track ongoing development.
View on GitHubDiscord Community
Join 400+ members to ask questions, share research, and collaborate on healthcare AI projects.
Join the serverResearch Initiative
A structured program of 10+ researchers — including healthcare domain experts — building and publishing open-source, reproducible clinical AI research on top of PyHealth. Apply to join and collaborate with clinicians, data scientists, and AI researchers advancing trustworthy healthcare AI.
Apply to join