Welcome to PyHealth#
The Python Library for Healthcare AI
pyhealth.dev β the new home for PyHealth news, updates, and resources β
Build, test, and deploy healthcare machine learning models with ease. PyHealth is designed for both ML researchers and medical practitioners. We can make your healthcare AI applications easier to develop, test and validate. Your development process becomes more flexible and more customizable. [GitHub]
Key Features
Dramatically simpler: Build any healthcare AI model in ~7 lines of code
Blazing fast: Up to 39Γ faster than pandas for task processing
Memory efficient: Runs on 16GB laptops
True multimodal: Unified API for EHR, medical images, biosignals, clinical text, and genomics
Production-ready: 25+ pre-built models, 20+ tasks, 12+ datasets with comprehensive evaluation tools
Healthcare-first: Built-in medical coding standards (ICD, CPT, NDC, ATC) and clinical datasets (MIMIC, eICU, OMOP)
[News!] Join us for PyHealth Casual Chats β informal sessions where you can ask questions, discuss research ideas, or talk about PyHealth developments! Everyone is welcome. Join Zoom β | Add to Calendar β
[News!] We are continuously implementing good papers and benchmarks into PyHealth, checkout the [Planned List]. Welcome to pick one from the list and send us a PR or add more influential and new papers into the plan list.
Get Started in Minutes#
PyHealth makes healthcare AI development simple and powerful. Build production-ready models with just a few lines of code.
from pyhealth.datasets import MIMIC3Dataset
from pyhealth.tasks import MortalityPredictionMIMIC3
from pyhealth.models import RNN
from pyhealth.trainer import Trainer
# Load healthcare data
dataset = MIMIC3Dataset(root="data/", tables=["diagnoses_icd", "procedures"])
samples = dataset.set_task(MortalityPredictionMIMIC3())
# Train model
model = RNN(dataset=samples)
trainer = Trainer(model=model)
trainer.train(train_dataloader, val_dataloader, epochs=50)
Thatβs it! You now have a trained healthcare AI model ready for deployment.