subject-subtyping

Discovers unsupervised patient subtypes from neuroimaging features using clustering and embedding models.

89|5|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill subject-subtyping-cuhk-aim-group
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: subject-subtyping
Source: https://github.com/CUHK-AIM-Group/NeuroDiscovery/tree/main/skills/subject-subtyping
Command: npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill subject-subtyping-cuhk-aim-group

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, scipy, scikit-learn, joblib, torch, matplotlib, and includes scripts (resource) components.

What problem does it solve? Researchers need to identify latent patient subgroups from neuroimaging or multimodal features without using outcome labels, while ensuring cluster stability and avoiding premature clinical interpretation. ## Core Features & Use Cases - Multiple clustering models: Supports K-means, Gaussian mixture models, spectral clustering, NMF, consensus clustering, PCA embeddings, and autoencoder embeddings. - Stability and diagnostics: Exports silhouette scores, bootstrap replicate agreement (adjusted Rand index, matched Jaccard), and per-subject QA metrics. - Reporting pipeline: Generates subtype assignments, feature profiles, group counts, embedding figures, and a verified run manifest from frozen assignments without retraining. - Use Case: A researcher with a CSV of ROI features for 200 subjects runs consensus clustering across k=2..8, compares silhouette and bootstrap stability, freezes k=3, then exports a patient-level subtype report with profiles and figures. ## Quick Start Run consensus clustering on my features.csv with subject_id column, 3 clusters, and seed 123, then generate the subtype report from the frozen assignments.

Frequently Asked Questions about subject-subtyping

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform patient stratification from neuroimaging features?

Prepare a CSV with a subject_id column and numeric imaging features, then run train_reference.py with a model such as consensus, gmm, or kmeans and a chosen cluster count. The script exports subtype assignments, embeddings, silhouette metrics, and a model checkpoint.

What clustering methods are available for disease subtyping?

Seven methods are supported: K-means, Gaussian mixture models, spectral clustering, NMF, consensus clustering, PCA embedding plus K-means, and autoencoder embedding plus K-means. Consensus clustering is recommended when stability is central to the claim.

How do I choose the number of clusters for subtyping?

Run a prespecified range such as k=2..8, compare silhouette scores and bootstrap stability, then freeze k before any clinical endpoint testing. Outcome labels must never be used to select the cluster count.

Can the trained subtyping model assign new patients?

Not directly. The training checkpoint does not bundle the fitted imputer and scaler, and spectral or consensus training defines no out-of-sample rule. A separately validated deployment pipeline preserving preprocessing and feature order is required for new-patient inference.

Why is cluster stability reported as not_evaluated?

Stability requires completed replicate runs supplied via repeated --replicate flags to report_subtypes.py. Without them, stability is explicitly marked not_evaluated rather than silently omitted, since replicate runs must cover the same subjects and represent genuine perturbations.