본문으로 건너뛰기
cccskills
무료GitHub에 공개

radiomics-ml

Use when building or auditing a radiomics or tabular clinical-ML prediction model with a classical learner (LASSO, SVM, random forest, XGBoost and similar). Enforces nested CV, dimensionality control, in-fold feature selection, feature stability, calibration and external validation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

실행 점수 미검증

설치 방법 보기

포함된 파일(12)

  • SKILL.md10.8 KB
  • references/radiomics_ml_guide.md11.2 KB
  • scripts/check_radiomics_ml_challenge/expected/strong.txt381 B
  • scripts/check_radiomics_ml_challenge/expected/weak.txt1.6 KB
  • scripts/check_radiomics_ml_challenge/fixture/pipeline_strong.json320 B
  • scripts/check_radiomics_ml_challenge/fixture/pipeline_weak.json313 B
  • scripts/check_radiomics_ml_challenge/problem.md894 B
  • scripts/check_radiomics_ml_challenge/verify.sh2.1 KB
  • scripts/check_radiomics_ml.py16.6 KB
  • skill.yml3.9 KB
  • tests/nested_cv_skeleton_check.py3.9 KB
  • tests/test_radiomics_ml.sh11.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Radiomics / Classical-ML Skill

Purpose

Radiomics + tree-ensemble studies (features → random forest / XGBoost → a clinical outcome) are the most common solo-doable clinical-ML workflow — no GPU, no engineer — and the most commonly over-optimistic: hundreds-to-thousands of features on tens of patients, hyperparameters tuned on the same folds the performance is reported from, features selected on the whole dataset, unstable features never filtered, and discrimination (AUC) reported without calibration. This skill produces the pipeline correctly and audits an existing one, so the clinical result survives review (Lambin 2017; CLEAR; TRIPOD+AI; PROBAST-AI).

It sits beside the imaging-DL lane: where /model-scaffold builds a deep network, radiomics-ml covers the feature-based classical-ML path. It integrates scikit-learn / xgboost / pyradiomics (referenced in the emitted code); it does not reimplement them and never runs a model on real patient data.

When to use

  • You have a radiomics or clinical/tabular feature table and want to build a random-forest / XGBoost clinical prediction model that will pass statistical review.
  • You want to audit an existing radiomics/ML pipeline for the failure modes below.

When NOT to use

  • Deep-learning imaging models → /model-selection → /model-scaffold → /model-assessment.
  • Classical inferential statistics / a regression model as the estimand → /analyze-stats.
  • Interpretability of a trained network → /model-assessment.
  • Reimplementing scikit-learn / xgboost / pyradiomics → out of scope (this skill wires and audits them).

The failure modes (what the gate enforces)

  1. No nested CV. Tuning and reporting on the same folds inflates performance. Use nested CV or a held-out test set.
  2. High dimensionality, low events. Candidate features ≥ events overfits — the classic radiomics trap. Declaring dimensionality_reduction does not clear it: n_features already counts what is left after outcome-blind reduction. The gate's p ≥ events rule (events = the minority class) is a floor that catches the worst case, not a sample-size criterion: size the study with /calc-sample-size Test 12 (Riley criteria, pmsampsize), counting every candidate feature that reaches outcome-driven selection or fitting. At C = 0.75 and 35% prevalence that is about 48 patients per candidate parameter: 100 candidates need N = 4,755 (1,665 events), and the gate passes 100 features on 105 events. Reduce candidates without the outcome first (stability, redundancy, clinical prior); LASSO or other penalisation does not substitute for sample size, because the shrinkage it estimates is itself unstable at small n (Riley et al., J Clin Epidemiol 2021; Van Calster et al., Stat Methods Med Res 2020).
  3. Selection outside the fold. Feature selection fit on the whole dataset leaks the held-out folds. Nest selection inside each training fold.
  4. No feature stability. Radiomics features are unstable across acquisition/segmentation — filter to reproducible features (ICC / test-retest).
  5. No calibration. A clinical prediction model needs calibration (slope/intercept + a flexible curve), not discrimination alone.
  6. No external validation. A single-cohort model needs external / temporal validation for a clinical claim.

Not in the gate, because the manifest cannot show it: rows of one patient on both sides of a split. Lesion-level tables with row-wise folds let the model recognise the patient; on null synthetic data this took nested-CV AUROC from 0.48 to 0.99. Split by patient and check the fold table (Phase 2).

Workflow

Phase 1 — Extract features (integrate, don't reimplement)

For radiomics, extract with pyradiomics under reproducible, IBSI-aligned settings (fixed bin width, resampling, normalisation) — record them. For clinical/tabular data, assemble the feature table with a patient/subject ID and the outcome. One row per lesion or ROI is fine; the ID is what the folds are split by. See references/radiomics_ml_guide.md.

Phase 2 — Build the pipeline correctly

  • Feature stability — with test-retest / multi-rater data, keep features with ICC ≥ 0.75.
  • Nested cross-validation — outer folds estimate performance, inner folds tune; do feature selection and scaling inside each training fold (never on the whole dataset). The CV unit is the patient: split both loops with StratifiedGroupKFold(groups=patient_id) so one patient's lesions never straddle folds, write the fold table (patient_id,split), and prove it with /model-assessment's check_split_leakage.py --splits cv_folds.csv --seed <seed> --strict (skeleton in the guide §4).
  • Dimensionality — reduce the candidate set without the outcome (ICC stability, |r| redundancy filter, clinical prior; PCA fit inside the fold), then size the study for the candidates that remain with /calc-sample-size Test 12 (pmsampsize). LASSO selects inside the fold but does not make a small sample large enough; report the shortfall as a limitation if N falls below the Riley minimum.
  • Model — pick from the full classical family for the task; a simple baseline (penalised logistic) is mandatory alongside any complex learner:
    • penalised regression — LASSO / ridge / elastic-net logistic (also the baseline)
    • margin / kernel — linear or RBF SVM
    • instance-based — k-NN
    • probabilistic / discriminant — naive Bayes, LDA / QDA
    • trees & bagging — decision tree, random forest, extra-trees
    • boosting — XGBoost, LightGBM, CatBoost, HistGBM, AdaBoost
    • shallow neural — MLP
    • meta — stacking / voting ensembles
    • unsupervised (upstream) — PCA / UMAP for reduction, k-means / hierarchical / GMM for phenotyping The gate below is learner-agnostic — it audits the pipeline (nested CV, leakage, dimensionality, calibration), so it applies identically to any of these. See the full method map in docs/method_coverage_map.md.
  • Report — discrimination and calibration (slope/intercept + flexible curve, via the /analyze-stats calibration guide) and clinical utility (decision curve). SHAP for interpretation.

Phase 3 — Emit the pipeline manifest

{
  "task": "classification",
  "n_features": 40, "n_samples": 300, "n_events": 110,
  "cv_scheme": "nested",
  "feature_selection_stage": "inside_cv",
  "dimensionality_reduction": true,
  "feature_stability": "icc",
  "calibration_reported": true,
  "external_validation": "temporal",
  "model": "xgboost"
}
  • n_features — the candidate features that reach outcome-driven selection or fitting, after outcome-blind reduction (here 1,200 extracted → ICC ≥ 0.75 → |r| < 0.9 → 40). This example passes the gate, yet pmsampsize (C = 0.75, prevalence 110/300) asks for N = 1,868 with 685 events for 40 candidate parameters: the gate does not size the study, Test 12 does. n_features, n_samples and n_events must be non-negative integers (n_events ≤ n_samples); anything else is an input error (exit 2). dimensionality_reduction is informational and clears nothing.
  • feature_selection_stage — inside_cv, outside_cv, or none (no outcome-driven selection). Missing or unrecognised is treated as not shown to be in-fold (SELECTION_OUTSIDE_CV).
  • feature_stability — icc / test_retest; external_validation — external / temporal / geographic. Any other value (e.g. planned, internal, bootstrap, random_split) is flagged. Values are case-insensitive; - and spaces read as _.
  • cv_scheme — nested, or held_out_test / single_split when hyperparameters and model choice were tuned on the training split only and the test split was touched once. A split that was also used for tuning, model selection or a threshold is flat (choosing among 12 candidate models on the test split of null data reported AUROC 0.63 instead of 0.51). At radiomics sample sizes a single random split wastes data and is unstable; prefer (repeated) nested CV (Steyerberg, J Clin Epidemiol 2018).

Phase 4 — Gate the pipeline (deterministic)

python3 scripts/check_radiomics_ml.py --manifest pipeline_manifest.json --strict

Verdicts: NO_NESTED_CV, HIGH_DIM_LOW_EVENTS, SELECTION_OUTSIDE_CV (Major); NO_FEATURE_STABILITY, NO_CALIBRATION, NO_EXTERNAL_VALIDATION, and HIGH_DIM_NOT_ASSESSED when n_features, n_samples or n_events is missing (Minor). Complements self-review's check_cv_leakage (which audits a finished manuscript's prose) at the pipeline-spec level.

Integration

  • /analyze-stats — calibration + clinical-utility (decision curve, NNT) guides for the reporting.
  • /check-reporting — CLEAR (radiomics), TRIPOD+AI, PROBAST-AI item coverage.
  • /self-review clinical_prediction_model probe audits the finished manuscript; this skill produces the rigorous pipeline it looks for.

Anti-Hallucination

  • Never fabricate features, performance metrics, or sample/event counts. Every value in the manifest and every reported metric comes from the researcher's executed code — never invented. This skill designs and audits the pipeline; it does not run a model on real patient data.
  • Never report flat-CV performance as if it were nested or held-out. Tuning on the reported folds is the optimism this skill exists to prevent (NO_NESTED_CV).
  • Never report a radiomics/ML audit "pass" without running check_radiomics_ml.py. The rigor verdict is reproduced deterministically, never asserted from prose.
  • Integrate, don't reimplement. Reference scikit-learn / xgboost / pyradiomics; do not write a new feature extractor or learner or claim results for one.

Reproducible challenge

scripts/check_radiomics_ml_challenge/ ships a synthetic weak/strong pipeline pair with a network-free verify.sh wired into the skill's validation commands.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when a medical AI paper should be found and cited by AI search engines and RAG tools. Optimizes the title, abstract, summary box (Key Points, Research in Context), keywords, preprint, GitHub README/CITATION.cff and Hugging Face card, returning a visible pass/fail checklist.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aperivue/medsci-skills3492026년 10월 22일 업데이트

Use when a target journal has no profile yet. Reads the journal's author guidelines and writes a detailed /write-paper profile plus a compact /find-journal profile, public or user-local private, in the canonical format with quality gates.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aperivue/medsci-skills3492026년 10월 22일 업데이트

Use when data needs statistical analysis. Runs reproducible Python/R code for Table 1, diagnostic accuracy, agreement, regression, survival, propensity score, survey-weighted and repeated-measures models, with publication tables. Sample size is /calc-sample-size; pooling studies is /meta-analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aperivue/medsci-skills3492026년 10월 22일 업데이트

Renamed to /model-selection in v6 (removed in v7).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aperivue/medsci-skills3492026년 10월 22일 업데이트

Use when analyzing a researcher's publication record from PubMed. Fetches an author's papers, classifies study types and author position, charts the patterns and writes a strategy report, with an optional trajectory-archetype classification. Works from PubMed metadata only.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aperivue/medsci-skills3492026년 10월 22일 업데이트

Use when one validated cohort analysis must be repeated across many exposure/outcome pairs. Generates one R/Python script per combination from a single methodology template, changing only the variables, and aggregates the results into a summary matrix.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Aperivue/medsci-skills3492026년 10월 22일 업데이트

Aperivue의 스킬 모두 보기

이 스킬의 문제 신고