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 →
/architecture-zoo → /model-scaffold → /model-validation.
- Classical inferential statistics / a regression model as the estimand →
/analyze-stats.
- Interpretability of a trained network →
/explainability.
- 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. Features ≥ events with no dimensionality reduction overfits —
the classic radiomics trap. Apply LASSO / PCA / a stability + redundancy filter.
- 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.
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. 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).
- Dimensionality — with features ≥ events, use LASSO / a stability+redundancy filter / PCA.
- 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": 1200, "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"
}
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 (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.
1---2name: radiomics-ml3description: Produce or audit a radiomics / tabular clinical-ML study — imaging or clinical features → any classical learner (penalised logistic [LASSO / ridge / elastic-net], SVM, k-NN, naive Bayes, LDA/QDA, decision tree, random forest, gradient boosting [XGBoost / LightGBM / CatBoost], shallow MLP, stacked ensembles) → a clinical outcome — so it clears the rigor bar reviewers expect: nested cross-validation (tuning never on the reported folds), dimensionality control for the features-far-exceed-events regime, feature selection inside the fold, feature-stability (ICC / test-retest) filtering, calibration, and external/temporal validation. The deterministic gate is learner-agnostic (it audits the pipeline, not the algorithm). Emits a pipeline manifest and the gate. The most common solo-doable clinical-ML workflow — no GPU, no engineer. Integrates scikit-learn / xgboost / lightgbm / catboost / pyradiomics; it does not reimplement them.4---56# Radiomics / Classical-ML Skill78## Purpose910Radiomics + tree-ensemble studies (features → random forest / XGBoost → a clinical outcome) are the11**most common solo-doable clinical-ML workflow** — no GPU, no engineer — and the **most commonly12over-optimistic**: hundreds-to-thousands of features on tens of patients, hyperparameters tuned on the13same folds the performance is reported from, features selected on the whole dataset, unstable features14never filtered, and discrimination (AUC) reported without calibration. This skill produces the pipeline15correctly and audits an existing one, so the clinical result survives review (Lambin 2017; CLEAR;16TRIPOD+AI; PROBAST-AI).1718It sits beside the imaging-DL lane: where `/model-scaffold` builds a deep network, **radiomics-ml**19covers the feature-based classical-ML path. It **integrates** scikit-learn / xgboost / pyradiomics20(referenced in the emitted code); it does not reimplement them and never runs a model on real patient21data.2223## When to use24- You have a radiomics or clinical/tabular feature table and want to build a random-forest / XGBoost25 clinical prediction model that will pass statistical review.26- You want to audit an existing radiomics/ML pipeline for the failure modes below.2728## When NOT to use29- Deep-learning imaging models → `/architecture-zoo` → `/model-scaffold` → `/model-validation`.30- Classical inferential statistics / a regression model as the estimand → `/analyze-stats`.31- Interpretability of a trained network → `/explainability`.32- Reimplementing scikit-learn / xgboost / pyradiomics → out of scope (this skill wires and audits them).3334## The failure modes (what the gate enforces)351. **No nested CV.** Tuning and reporting on the same folds inflates performance. Use nested CV or a36 held-out test set.372. **High dimensionality, low events.** Features ≥ events with no dimensionality reduction overfits —38 the classic radiomics trap. Apply LASSO / PCA / a stability + redundancy filter.393. **Selection outside the fold.** Feature selection fit on the whole dataset leaks the held-out folds.40 Nest selection inside each training fold.414. **No feature stability.** Radiomics features are unstable across acquisition/segmentation — filter42 to reproducible features (ICC / test-retest).435. **No calibration.** A clinical prediction model needs calibration (slope/intercept + a flexible44 curve), not discrimination alone.456. **No external validation.** A single-cohort model needs external / temporal validation for a46 clinical claim.4748## Workflow4950### Phase 1 — Extract features (integrate, don't reimplement)51For radiomics, extract with **pyradiomics** under reproducible, IBSI-aligned settings (fixed bin width,52resampling, normalisation) — record them. For clinical/tabular data, assemble the feature table with a53patient/subject ID and the outcome. See `references/radiomics_ml_guide.md`.5455### Phase 2 — Build the pipeline correctly56- **Feature stability** — with test-retest / multi-rater data, keep features with ICC ≥ 0.75.57- **Nested cross-validation** — outer folds estimate performance, inner folds tune; do **feature58 selection and scaling inside each training fold** (never on the whole dataset).59- **Dimensionality** — with features ≥ events, use LASSO / a stability+redundancy filter / PCA.60- **Model** — pick from the full classical family for the task; a simple baseline (penalised logistic)61 is mandatory alongside any complex learner:62 - *penalised regression* — LASSO / ridge / elastic-net logistic (also the baseline)63 - *margin / kernel* — linear or RBF SVM64 - *instance-based* — k-NN65 - *probabilistic / discriminant* — naive Bayes, LDA / QDA66 - *trees & bagging* — decision tree, random forest, extra-trees67 - *boosting* — XGBoost, LightGBM, CatBoost, HistGBM, AdaBoost68 - *shallow neural* — MLP69 - *meta* — stacking / voting ensembles70 - *unsupervised (upstream)* — PCA / UMAP for reduction, k-means / hierarchical / GMM for phenotyping71 The gate below is **learner-agnostic** — it audits the pipeline (nested CV, leakage, dimensionality,72 calibration), so it applies identically to any of these. See the full method map in73 [`docs/method_coverage_map.md`](../../docs/method_coverage_map.md).74- **Report** — discrimination **and** calibration (slope/intercept + flexible curve, via the75 `/analyze-stats` calibration guide) and clinical utility (decision curve). SHAP for interpretation.7677### Phase 3 — Emit the pipeline manifest78```json79{80 "task": "classification",81 "n_features": 1200, "n_samples": 300, "n_events": 110,82 "cv_scheme": "nested",83 "feature_selection_stage": "inside_cv",84 "dimensionality_reduction": true,85 "feature_stability": "icc",86 "calibration_reported": true,87 "external_validation": "temporal",88 "model": "xgboost"89}90```9192### Phase 4 — Gate the pipeline (deterministic)93```bash94python3 scripts/check_radiomics_ml.py --manifest pipeline_manifest.json --strict95```96Verdicts: `NO_NESTED_CV`, `HIGH_DIM_LOW_EVENTS`, `SELECTION_OUTSIDE_CV` (Major);97`NO_FEATURE_STABILITY`, `NO_CALIBRATION`, `NO_EXTERNAL_VALIDATION` (Minor). Complements98`self-review`'s `check_cv_leakage` (which audits a finished manuscript's prose) at the pipeline-spec99level.100101## Integration102- **`/analyze-stats`** — calibration + clinical-utility (decision curve, NNT) guides for the reporting.103- **`/check-reporting`** — CLEAR (radiomics), TRIPOD+AI, PROBAST-AI item coverage.104- **`/self-review`** `clinical_prediction_model` probe audits the finished manuscript; this skill105 *produces* the rigorous pipeline it looks for.106107## Anti-Hallucination108109- **Never fabricate features, performance metrics, or sample/event counts.** Every value in the110 manifest and every reported metric comes from the researcher's executed code — never invented. This111 skill designs and audits the pipeline; it does not run a model on real patient data.112- **Never report flat-CV performance as if it were nested or held-out.** Tuning on the reported folds113 is the optimism this skill exists to prevent (`NO_NESTED_CV`).114- **Never report a radiomics/ML audit "pass" without running `check_radiomics_ml.py`.** The rigor115 verdict is reproduced deterministically, never asserted from prose.116- **Integrate, don't reimplement.** Reference scikit-learn / xgboost / pyradiomics; do not write a new117 feature extractor or learner or claim results for one.118119## Reproducible challenge120`scripts/check_radiomics_ml_challenge/` ships a synthetic weak/strong pipeline pair with a network-free121`verify.sh` wired into the skill's validation commands.