科研 Skill
影像组学机器学习建模
radiomics-ml
Enforces nested cross-validation and calibration for a radiomics or tabular ML model. Use when building or auditing a classical-learner clinical-ML prediction model.
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)
- No nested CV. Tuning and reporting on the same folds inflates performance. Use nested CV or a held-out test set.
- High dimensionality, low events. Candidate features ≥ events overfits — the classic radiomics
trap. Declaring
dimensionality_reductiondoes not clear it:n_featuresalready counts what is left after outcome-blind reduction. The gate'sp ≥ eventsrule (events = the minority class) is a floor that catches the worst case, not a sample-size criterion: size the study with/calc-sample-sizeTest 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). - Selection outside the fold. Feature selection fit on the whole dataset leaks the held-out folds. Nest selection inside each training fold.
- No feature stability. Radiomics features are unstable across acquisition/segmentation — filter to reproducible features (ICC / test-retest).
- No calibration. A clinical prediction model needs calibration (slope/intercept + a flexible curve), not discrimination alone.
- 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'scheck_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-sizeTest 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-statscalibration 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, yetpmsampsize(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_samplesandn_eventsmust be non-negative integers (n_events≤n_samples); anything else is an input error (exit 2).dimensionality_reductionis informational and clears nothing.feature_selection_stage—inside_cv,outside_cv, ornone(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, orheld_out_test/single_splitwhen 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 isflat(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-reviewclinical_prediction_modelprobe 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.
示例提示词
帮我用嵌套交叉验证建一个LASSO影像组学预测模型。
所属插件
安装该插件会一并获得同领域的 58 个 Skill / MCP。
同插件的其他科研 Skill
- 医学AI论文检索优化Optimizes a medical AI paper’s title, abstract and metadata for AI search engines. Use when a paper should be findable and citable by RAG tools and AI search.
- 临床数据统计分析与建模Generates reproducible Python or R code for clinical statistics and tables. Use when collected data needs Table 1, regression, survival or agreement analysis.
- 作者发表记录与策略分析Analyzes a PubMed author record to classify study types and authorship patterns. Use when planning a publication strategy from a researcher’s track record.
- 批量队列暴露结局分析Generates one cohort-analysis script per exposure-outcome pair from one template. Use when a validated method must run across many variable combinations at once.
- 样本量估算与检验效能Walks a decision tree to the right test and computes sample size with IRB text. Use when planning how many patients a study needs before data collection.
- 因果推断方法设计Runs DAG-based, instrumental-variable, difference-in-differences or RD analyses. Use when an association in observational data must support a causal claim.
- 报告规范逐条核查Audits a manuscript item by item against 49 reporting and risk-of-bias checklists. Use when checking a draft against STROBE, CONSORT, TRIPOD or similar guidelines.
- 临床数据清洗与画像Profiles a clinical dataset and generates cleaning code in staged, approved steps. Use when a CSV or Excel dataset needs missing-value and outlier checks before analysis.
- 跨国队列数据协调对比Harmonizes variables and runs parallel weighted analyses across national surveys like KNHANES and NHANES. Use when comparing one exposure-outcome link across countries.
- 变量定义与截断值溯源Maps exposure, outcome and covariate definitions to a cited guideline and DB columns. Use when variable cutoffs need a citable basis before the study protocol.
- 本地化临床数据脱敏Runs a local, network-free script that detects and removes identifiers from clinical data. Use when data may contain PHI and must be de-identified before LLM analysis.
- AI对标专家基准研究设计Plans the arms, rubrics, calibration probes and reviewer panel for an AI-vs-expert benchmark. Use before data collection when designing an AI-vs-human rating study.
- 放射影像AI研究设计审查Reviews a study’s analysis unit, cohort logic, leakage risk and reporting-guideline fit. Use when checking a clinical or medical-AI study design before drafting.
- 传染病仓室模型拟合Builds and fits SIR, SEIR and SEIHR compartmental models with Rt estimation. Use when an outbreak or epidemic’s spread needs mathematical modeling in Python.
- ICMJE利益冲突声明填写Clones a pre-filled synthetic ICMJE COI form, replacing only date, name and title. Use when each author on a submission needs a disclosure form filled quickly.
- 机构Word表单内容填充Fills an institutional Word form, such as an IRB protocol, without breaking its layout. Use when drafted content must be rendered into a CJK-aware .docx template.
- 队列数据库选题挖掘Profiles a longitudinal cohort database and ranks research-topic proposals with gap evidence. Use when looking for a question an available cohort or registry can answer.
- 投稿期刊匹配推荐Matches a manuscript abstract against curated journal profiles and ranks candidates. Use when choosing where to submit, or re-targeting after a rejection.
- DOI全文批量获取Batch-downloads open-access PDFs for a list of DOIs via Unpaywall, PMC and OpenAlex. Use when full texts are needed for a screening set such as a meta-analysis.
- 数据集编码本自动生成Profiles every variable in a tabular dataset into a structured, citable codebook. Use when a CSV, Excel or Stata dataset needs a data dictionary before analysis.
- 全球卫生数据获取分析Accesses and analyzes global health data from WHO GHO, IHME GBD and Our World in Data. Use when DALYs, age-standardized rates or choropleth maps are needed.
- 医学AI项目基金申请书撰写Structures a grant proposal’s significance, innovation, approach, aims and milestones. Use when drafting a research funding proposal, including a Korean grant plan.
- 卫生经济学评价建模Builds Markov cohort models with QALYs, PSA and cost-effectiveness planes. Use when a health intervention needs a formal cost-effectiveness evaluation.
- AI写作痕迹识别改写Scans a manuscript for AI writing patterns and rewrites flagged passages carefully. Use when a draft or response letter reads as obviously AI-written.
常见问题
影像组学机器学习建模能做什么?
Enforces nested cross-validation and calibration for a radiomics or tabular ML model. Use when building or auditing a classical-learner clinical-ML prediction model。
如何安装影像组学机器学习建模?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「影像组学机器学习建模」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
影像组学机器学习建模需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
影像组学机器学习建模经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。