pyhealth
Skill by K-Dense-AI
Guides building and validating PyHealth clinical machine-learning pipelines for EHR, signals, imaging and medical codes. Written for developers and researchers working with PyHealth 2.0.2 datasets and prediction tasks.
Install pyhealth
Built from the published package, never by AI.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/pyhealth ~/.claude/skills/pyhealthRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/K-Dense-AI/scientific-agent-skills /tmp/scientific-agent-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/scientific-agent-skills/skills/pyhealth ~/.gemini/antigravity-cli/skills/pyhealthAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill helps an AI assistant build and validate clinical machine-learning pipelines with the PyHealth 2.0.2 library. It covers EHR, physiological signal, imaging and medical-code work, including MIMIC-III, MIMIC-IV, eICU and OMOP prediction tasks. The source describes the pipeline as Dataset, Task, Model, Trainer and Metrics.
The skill tells the assistant to define the cohort, prediction time, observation window and outcome horizon before modeling. It stresses patient-level splitting, a one-batch check before training and a single held-out test evaluation. It includes a synthetic in-memory demo and reference files on datasets, tasks, models and medical codes. It is aimed at researchers and developers doing clinical prediction with PyHealth.
Written from the project's SKILL.md and checked against it.
What it can do
- Load clinical datasetsSets up PyHealth dataset classes for MIMIC-III, MIMIC-IV, eICU and OMOP data.
- Define prediction tasksBuilds supervised tasks such as mortality, readmission and length-of-stay prediction.
- Split by patientUses split_by_patient to keep each patient in a single partition.
- Train modelsRuns PyHealth models such as Transformer through the Trainer with metrics and monitoring.
- Restore best checkpointsKeeps the best checkpoint according to a declared validation metric.
- Map medical codesLooks up and maps ICD, ATC, NDC and RxNorm codes.
- Run a synthetic demoRuns a bundled starter pipeline on invented records to test the setup.
- Check task semanticsReviews label definitions, required tables and possible leakage before training.
What you need
- Python 3.12 or 3.13
- PyHealth 2.0.2 with Torch 2.7.1
- Network access for installation, public datasets and medical-code resources
- Authorized local access for restricted clinical datasets
Try asking
- Run the PyHealth synthetic demo pipeline for one epoch
- Build a MIMIC-III mortality task with patient-level splits
- Map ICD diagnosis codes to ATC codes using PyHealth
Good to know
- The demo uses invented records and provides no evidence of clinical performance.
- Random patient splits are not chronological or stratified.
- Restricted clinical datasets require authorized local access.
- The MIMIC-III mortality task predicts death in the next admission, not the current stay.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/pyhealth/SKILL.md, skills/pyhealth/assets/starter_pipeline.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md8 KB -
assets/starter_pipeline.py4 KB -
references/datasets.md5 KB -
references/examples.md7 KB -
references/installation.md4 KB
Show all 8 files
-
references/medcode.md4 KB -
references/models.md6 KB -
references/tasks.md6 KB
Alternatives to pyhealth
All alternatives →Searches arXiv for scientific papers and preprints, extracts their metadata and abstracts, and downloads PDF or HTML full text. Suited to users who need research papers, literature or specific arXiv IDs.
Downloads AlphaFold predicted structures and PAE matrices for a UniProt ID, then reports pLDDT confidence, domain boundaries and disorder. Built for users who already have a UniProt accession.
Queries the QuickGO and Evidence & Conclusion Ontology REST API to map genes to Gene Ontology terms. Built for researchers doing functional annotation and GO hierarchy exploration.
Connects an AI assistant to Peloton to browse fitness classes, check live and archived schedules, and manage workouts. Built for Peloton users who want to plan rides from their assistant.
Queries NCBI Gene through the E-utilities and Datasets API. It helps researchers search genes by symbol or ID, retrieve gene details, and run batch lookups for annotation and functional analysis.
Prepares and launches nf-core/pacsomatic runs for matched tumor-normal PacBio HiFi data starting from unaligned BAM files. It generates samplesheets and pinned launch artifacts, then runs locally or submits to a scheduler.
Compare with literature-search-arxiv, alphafold-database-fetch-and-analyze or quickgo-database
pyhealth: common questions
What is the PyHealth skill used for?
It helps build and validate clinical machine-learning pipelines for EHR, signals, imaging and medical codes using PyHealth 2.0.2.
Does the skill need real patient data?
No. The bundled starter trains on invented in-memory records. Restricted clinical datasets need authorized local access.
Does the demo show clinical accuracy?
No. The source says the demo exercises the pipeline only and provides no evidence of clinical performance.
How do I install pyhealth?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is pyhealth free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is pyhealth safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to pyhealth?
Similar skills: literature-search-arxiv, alphafold-database-fetch-and-analyze, quickgo-database, peloton.
