pyhealth

Build clinical machine learning pipelines from raw patient data to evaluated predictions.

74|5|Updated Dec 10, 2025
One-click install
npx skills add https://github.com/dralkh/seerai --skill pyhealth-dralkh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pyhealth
Source: https://github.com/dralkh/seerai/tree/main/skills/pyhealth
Command: npx skills add https://github.com/dralkh/seerai --skill pyhealth-dralkh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

PyHealth removes the friction from building healthcare machine learning pipelines by turning raw clinical data into supervised samples, trainable models, and measurable results through one consistent workflow.

Core Features & Use Cases

  • Unified clinical pipeline: Work across electronic health records, physiological signals, imaging, and text using the same Dataset → Task → Model → Trainer → Metrics pattern.
  • Healthcare use cases: Predict mortality, readmission, length of stay, drug recommendation, sleep stages, EEG events, and ICD coding with dataset-specific tasks and models.
  • Medical code utilities: Look up, normalize, and cross-map ICD, ATC, NDC, RxNorm, and CCS codes for cleaner labels and more interpretable outputs.
  • Research workflows: Use patient-level splits, cached dataset parsing, and built-in trainers to accelerate reproducible clinical research.

Quick Start

Ask for a PyHealth pipeline for your dataset and prediction task, and I will map the right dataset, task, model, split strategy, and evaluation metric for you.

Frequently Asked Questions about pyhealth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a clinical ML pipeline from raw MIMIC or eICU data?

To build a clinical ML pipeline, you map your raw MIMIC or eICU data through a Dataset → Task → Model → Trainer → Metrics workflow to generate supervised samples and evaluated predictions. This enforces patient-level splitting and dataset-specific task matching for reproducible research.

What healthcare prediction tasks can I run using electronic health records?

You can run healthcare prediction tasks such as mortality prediction, readmission, length of stay, and drug recommendation using electronic health records. The pipeline matches dataset-specific tasks with the correct monitor metric for binary, multiclass, or multilabel learning.

Can I use the same workflow for physiological signals and chest X-ray imaging?

Yes, you can use the same unified workflow for physiological signals and chest X-ray imaging. It applies the consistent Dataset → Task → Model → Trainer → Metrics pattern across EHRs, SleepEDF, EEG, and imaging data to produce measurable prediction results.

How do I normalize and cross-map medical codes like ICD and RxNorm?

You normalize and cross-map medical codes like ICD, ATC, NDC, RxNorm, and CCS using built-in medical code utilities. This process cleans labels and creates more interpretable outputs for ICD coding and code normalization tasks.

What is the correct way to split patient data for clinical machine learning models?

The correct way to split patient data for clinical machine learning models is to use patient-level splitting. This prevents data leakage across training and test sets, ensuring that the evaluated predictions from the Trainer and Metrics stages remain statistically valid.

Does PyHealth support sleep staging and EEG event prediction workflows?

Yes, PyHealth supports sleep staging and EEG event prediction workflows using datasets like SleepEDF. It maps the physiological signal data through the standard pipeline to train models and evaluate predictions with the appropriate multiclass monitor metrics.