# Build Clinical Machine Learning Workflows with PyHealth

Clinical machine learning projects require specialized data, task, model, and evaluation choices. This skill provides structured PyHealth guidance from dataset preparation through validation.

## Install

```bash
npx skillstore add davila7/pyhealth
```

## Metadata

- Status: approved
- Slug: davila7-pyhealth
- Skillstore revision: r2
- Version status: missing
- Tree hash: 87aeb35e349fc3958cb851f61cf83529abbd3234c02a3dd2535d50d14b62d8a9
- Author: davila7
- GitHub username: davila7
- License: MIT
- Repository: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pyhealth
- Ref: c43861a65bb95efcae259cd161c9d6f4dc7eec6f
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: scripts, external\_commands, network
- Quality score: 76
- Public page: https://skillstore.pages.dev/skills/davila7-pyhealth
- Manifest: https://skillstore.pages.dev/api/skills/davila7-pyhealth/manifest

## Capabilities

- Guides loading and patient-level splitting for MIMIC, eICU, OMOP, and sleep EEG datasets.
- Defines mortality, readmission, drug recommendation, sleep staging, imaging, and clinical text tasks.
- Compares baseline, deep learning, and healthcare-specific models, including RETAIN, SafeDrug, Transformer, and GNN.
- Explains preprocessing for event sequences, physiological signals, labels, clinical text, and images.
- Covers training, evaluation, calibration, fairness, uncertainty, and interpretation with PyHealth Trainer.
- Explains medical code lookup and translation using InnerMap and CrossMap.

## Use Cases

- Design a Clinical Prediction Study: Plan cohorts, patient-level splits, baselines, PyHealth models, metrics, calibration, and subgroup evaluation for a clinical prediction task.
- Standardize Healthcare Data: Map diagnosis and medication codes, process longitudinal events, and prepare consistent PyHealth samples across data sources.
- Validate a Healthcare Model: Review discrimination, calibration, uncertainty, interpretability, fairness, and external validation requirements before deployment.

## Prompt Templates

### Plan a PyHealth Project

```
Plan a beginner PyHealth workflow for [dataset] and [clinical_task]. Explain required data, task setup, model baseline, split strategy, and metrics.
```

### Prepare Clinical Data

```
Design preprocessing for [data_type] in PyHealth. Include missing values, encoding, patient-level splitting, leakage checks, and validation statistics.
```

### Compare Healthcare Models

```
Compare [models] for [task] using [dataset]. Recommend hyperparameters, metrics, calibration, fairness checks, and interpretation methods with clear tradeoffs.
```

### Design Multisite Validation

```
Draft an end-to-end PyHealth experiment for [task] across [sites]. Include external validation, uncertainty, subgroup analysis, deployment gates, and reproducibility controls.
```

## Limitations

- The skill does not provide clinical datasets, licenses, or access credentials.
- Examples require a local PyHealth installation and compatible dataset versions.
- The guidance does not replace clinical validation, privacy review, or regulatory approval.
- Generated workflows require clinician and engineer review before healthcare deployment.

## Best Practices

- Split records by patient to prevent leakage across training, validation, and test sets.
- Start with a simple baseline before comparing specialized healthcare models.
- Evaluate calibration, fairness, uncertainty, and external validity alongside predictive performance.

## Anti Patterns

- Do not place records from one patient in multiple dataset splits.
- Do not choose metrics without considering class imbalance and clinical consequences.
- Do not deploy predictions without privacy, clinical, fairness, and external validation reviews.

## Security Audit

- Audited at: 2026-07-23T16:04:54.699\+00:00
- Summary: All 60 static findings are false positives caused by Markdown syntax, standard Python imports, clinical terminology, and documentation links. The examples include one fixed installation command, with no automatic execution, command interpolation, reconnaissance, or suspicious network behavior. No prompt injection, social engineering, or data exfiltration intent was found.

## Stats

- Views: 527
- Downloads: 11
- Favorites: 0
- Popularity score: 0
