К основному содержанию
скилл CX Codex

tooluniverse-diagnostic-test-evaluation — скилл для Claude Code

Скилл tooluniverse-diagnostic-test-evaluation оценивает точность диагностических тестов и биомаркеров по таблице 2×2 или непрерывным шкалам. Рассчитывает чувствительность, специфичность, ROC AUC и байесовскую вероятность.

Apache-2.0 129 установок ★ 1 798 обновлён 2026-10-24

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add mims-harvard/ToolUniverse --skill tooluniverse-diagnostic-test-evaluation -a claude-code
Открыть на GitHub

Что делает tooluniverse-diagnostic-test-evaluation

Скилл структурирует оценку диагностической точности по трём сценариям. Для фиксированного порога и таблицы сопряжённости 2×2 утилита Epidemiology_diagnostic считает чувствительность, специфичность, точность, отношения правдоподобия LR+ и LR−, а также прогностическую ценность положительного и отрицательного результатов (PPV и NPV).

При работе с непрерывными биомаркерами инструмент ROC_analysis или скрипт roc_analysis.py строят ROC-кривую, вычисляют площадь под ней (AUC) с 95% бутстреп-интервалом и находят оптимальный порог по индексу Юдена. Если задана априорная вероятность заболевания, команда Epidemiology_bayesian пересчитывает результат теста в апостериорную вероятность по теореме Байеса.

Для оценки двух тестов на одной выборке базового скрипта недостаточно: расчёт парного теста Делона в него не входит.

Какие задачи решает

  • рассчитать чувствительность, специфичность, LR+ и LR− по таблице 2×2
  • построить ROC-кривую и найти оптимальный порог по индексу Юдена
  • вычислить апостериорную вероятность болезни через теорему Байеса
  • оценить PPV и NPV с учётом реальной распространённости заболевания

Примеры запросов агенту

  • Оцени диагностическую точность по таблице 2x2: TP=90, FP=10, TN=180, FN=20 через Epidemiology_diagnostic
  • Запусти ROC_analysis для файла scores.csv и найди оптимальный порог Юдена
  • Посчитай апостериорную вероятность болезни через Epidemiology_bayesian при чувствительности 0.90, специфичности 0.95 и распространённости 0.10

Как установить tooluniverse-diagnostic-test-evaluation

1Через Skills CLI (Vercel)

npx skills add mims-harvard/ToolUniverse --skill tooluniverse-diagnostic-test-evaluation -a claude-code

2Вручную: положить файлы

~/.claude/skills/tooluniverse-diagnostic-test-evaluation/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/tooluniverse-diagnostic-test-evaluation/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о tooluniverse-diagnostic-test-evaluation

Как установить tooluniverse-diagnostic-test-evaluation в Claude Code?

Выполните команду npx skills add mims-harvard/ToolUniverse --skill tooluniverse-diagnostic-test-evaluation -a claude-code.

Что делает tooluniverse-diagnostic-test-evaluation?

Скилл проводит расчёт метрик диагностических тестов: обрабатывает таблицы 2×2, строит ROC-кривые с AUC для непрерывных биомаркеров и вычисляет апостериорную вероятность исхода по Байесу.

Почему скилл требует указывать распространённость заболевания при расчёте PPV?

Чувствительность и специфичность не зависят от популяции, но PPV и NPV меняются при другой распространённости. При редком заболевании даже тест с высокой специфичностью даёт низкую положительную прогностическую ценность.

Исходный текст

SKILL.md · Apache-2.0
---
name: tooluniverse-diagnostic-test-evaluation
description: Diagnostic test / biomarker accuracy — sensitivity, specificity, PPV, NPV, likelihood ratios, accuracy from a 2x2 table; ROC curve, AUC, and the optimal cutoff (Youden) for a continuous biomarker; and post-test probability via Bayes. Use when you have test results vs a gold standard (binary 2x2, or a continuous score + true labels) and need to judge how good the test is, pick a threshold, or compute the probability of disease given a result. Emphasizes the prevalence-dependence of PPV/NPV.
disable-model-invocation: true
---

# Diagnostic Test / Biomarker Accuracy Evaluation

Judge how well a test or biomarker discriminates disease — at a fixed cutoff (2×2) or across all cutoffs (ROC) — and turn a result into a probability of disease.

## Which case are you in?

| You have… | Go to |
|---|---|
| A 2×2 table (TP/FP/TN/FN) at a fixed cutoff | **Step 1** (`Epidemiology_diagnostic`) |
| A **continuous** biomarker score + true labels | **Step 2** (ROC / AUC / Youden, Python) |
| A test's sens/spec + a patient's pre-test probability | **Step 3** (`Epidemiology_bayesian`) |

## Step 1 — Fixed-cutoff metrics from a 2×2 table

```bash
tu run Epidemiology_diagnostic '{"operation":"diagnostic","tp":90,"fp":10,"tn":180,"fn":20}'
```

Returns `sensitivity`, `specificity`, `PPV`, `NPV`, `accuracy`, `LR_pos`, `LR_neg`, and the sample `prevalence`.

| Metric | Question it answers | Depends on prevalence? |
|---|---|---|
| **Sensitivity** = TP/(TP+FN) | Of those WITH disease, what fraction test positive? | No |
| **Specificity** = TN/(TN+FP) | Of those WITHOUT disease, what fraction test negative? | No |
| **PPV** = TP/(TP+FP) | If positive, what's the chance of disease? | **Yes — strongly** |
| **NPV** = TN/(TN+FN) | If negative, what's the chance of being disease-free? | **Yes** |
| **LR+** = sens/(1−spec) | How much a positive raises the odds of disease | No |
| **LR−** = (1−sens)/spec | How much a negative lowers the odds | No |

> **The PPV/NPV trap.** Sensitivity and specificity are properties of the *test*; **PPV and NPV depend on the disease prevalence in the tested population.** A test with great sens/spec has poor PPV in a low-prevalence (screening) setting. Never quote PPV/NPV from a case-control design (its 50/50 prevalence is artificial) — compute them for the real-world prevalence with `Epidemiology_bayesian` (Step 3). Report **sensitivity, specificity, and likelihood ratios** as the prevalence-independent summary.

## Step 2 — ROC / AUC / optimal cutoff for a continuous biomarker

When the test is a continuous score, evaluate across **all** thresholds:

Prefer the **`ROC_analysis`** tool — one call returns structured JSON (AUC + bootstrap 95% CI, Youden-optimal cutoff with its sens/spec, optional metrics at a fixed cutoff, and the ROC curve), and works under the MCP server without a shell:

```
ROC_analysis(scores=[...], labels=[0,1,...])          # inline arrays
ROC_analysis(csv_path="scores.csv", cutoff=0.6)        # or a CSV (cols: label, score)
```

The bundled script is the equivalent CLI form:

```bash
python skills/tooluniverse-diagnostic-test-evaluation/scripts/roc_analysis.py --input scores.csv
# scores.csv columns: label (1=disease, 0=healthy), score (continuous biomarker)
```

Both report AUC (with a bootstrap 95% CI), the **Youden-optimal cutoff** (max sensitivity+specificity−1) and its sens/spec.

| AUC | Discrimination |
|---|---|
| 0.5 | no better than chance |
| 0.7–0.8 | acceptable |
| 0.8–0.9 | excellent |
| >0.9 | outstanding |

- The **Youden** cutoff weights sensitivity and specificity equally; if false negatives and false positives have different costs, pick the threshold from the clinical tradeoff, not Youden.
- Once you choose a cutoff, build its 2×2 and run Step 1 for the fixed-cutoff metrics at that operating point.

## Step 3 — Post-test probability (Bayes)

Turn a result into the probability of disease for a given pre-test probability/prevalence:

```bash
tu run Epidemiology_bayesian '{"operation":"bayesian","prevalence":0.10,
  "sensitivity":0.90,"specificity":0.95,"test_result":"positive"}'
```

Returns `pre_test_odds`, the `LR`, and `post_test_probability`. This is how you get the *real-world* PPV: plug the true prevalence in. (Example: a 90%/95% test at 10% prevalence gives a post-positive probability of only ~67%, not 95%.)

## Gotchas (state these)

- **PPV/NPV without a stated prevalence are meaningless** — always give the prevalence they assume.
- **AUC ignores the operating point.** A high AUC doesn't tell you the test is useful at the threshold you'll actually use — report sens/spec at the chosen cutoff too.
- **Class imbalance.** With very few positives, ROC/AUC can look good while PPV is poor; consider a precision-recall curve and always report PPV at the real prevalence.
- **Spectrum bias.** Sens/spec measured on clearly-sick vs clearly-healthy subjects overestimate real-world performance on borderline cases.
- **Single cutoff chosen on the same data** it's evaluated on is optimistic — validate the threshold on a held-out set.

## Honest limitations

- These are discrimination/accuracy metrics, not calibration — a well-discriminating model can still output poorly-calibrated probabilities.
- A single AUC compares nothing; to compare two tests on the same patients, use a paired AUC test (DeLong) — beyond the basic script here.

## Related skills
- `tooluniverse-statistical-modeling` — logistic regression that produces the score, ORs.
- `tooluniverse-epidemiological-analysis` — population-level risk, screening program metrics.
- `tooluniverse-meta-analysis` — pool diagnostic accuracy across studies.

© mims-harvard · Apache-2.0 · mims-harvard/ToolUniverse

Похожие скиллы

Все скиллы по теме «Наука и исследования» →
clinical-decision-support davila7 Скилл clinical-decision-support для Claude Code создаёт клинические отчёты с анализом когорт, биомаркерами, оценкой доказательств и алгоритмами выбора лечения. Используется в исследованиях и разработке препаратов. CX Codex +1 60установок ab-test-analysis VoltAgent Субагент ab-test-analysis оценивает результаты A/B-тестирования, проверяет статистическую значимость и метрики безопасности для решений о запуске фичи. CX Codex ★ 6 505звёзд репо ads-test AgriciDaniel Скилл ads-test для Claude Code, Codex, Cursor и других платформ: помогает спроектировать и разобрать рекламный эксперимент — от гипотезы до решения. Проходит все шаги: единица рандомизации, расчёт выборки, гарды, анализ результатов. CX Codex +1 4 000установок ad-test-designer aaron-he-zhu Скилл ad-test-designer проектирует A/B-тесты креативов и лендингов, а затем анализирует результаты по собственным данным. Он также помогает спланировать тест на инкрементальность. CX Codex +1 1 100установок ab-test-setup OpenClaudia Скилл ab-test-setup для Claude Code помогает спроектировать A/B-тест, рассчитать выборку и разобрать результаты. Запускается на запросы об эксперименте, значимости и конверсии. CX Codex +1 435установок analyze-test Paweł Huryn Команда analyze-test анализирует результаты A/B-тестов: проверяет статистическую значимость, валидирует объём выборки и выдаёт рекомендацию — запустить, продлить или остановить эксперимент. CX Codex +1 ★ 28 211звёзд репо

Из того же набора136

Весь набор →
tooluniverse-protein-sae-variant-interpretation Скилл tooluniverse-protein-sae-variant-interpretation объясняет механизм мутаций белка через разреженные автоэнкодеры ESMC-6B, показывая потерю или появление биологических признаков. CX Codex +1 140установок tooluniverse-residue-functional-mechanism-interpretation Скилл tooluniverse-residue-functional-mechanism-interpretation для Claude Code объясняет значимость аминокислотных остатков по структуре белка, данным UniProt и опциональным свидетельствам DMS или SAE. CX Codex +1 140установок tooluniverse-mendelian-randomization Скилл tooluniverse-mendelian-randomization проверяет, вызывает ли один фактор другой (например, холестерин — болезнь сердца), используя генетические варианты как инструменты. CX Codex +1 137установок tooluniverse-primer-design Скилл tooluniverse-primer-design подбирает праймеры для PCR и qPCR, считает температуру плавления и проверяет олигонуклеотиды на димеры. CX Codex +1 131установок tooluniverse-dose-response Скилл tooluniverse-dose-response для Claude Code подбирает 4PL-кривую по концентрациям и ответам, оценивает IC50 или EC50 и качество подгонки. Сравнивает активность соединений в лабораторных анализах. CX Codex +1 128установок tooluniverse-enzyme-kinetics Скилл tooluniverse-enzyme-kinetics рассчитывает параметры ферментативной кинетики Михаэлиса — Ментен по экспериментальным точкам и определяет тип ингибирования. CX Codex +1 128установок tooluniverse-drug-synergy Скилл tooluniverse-drug-synergy вычисляет, действуют ли два препарата синергично, аддитивно или антагонистично. CX Codex +1 127установок tooluniverse-clinical-risk-scoring Скилл tooluniverse-clinical-risk-scoring для Claude Code, Codex, Cursor и других агентов считает валидированные клинические шкалы риска по данным конкретного пациента. CX Codex +1 125установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой