CPM Skill

SkillAI & models

Use this model skill whenever the user wants Connectome Predictive Modeling with fold-local functional-connectivity edge selection for classification or regression. Triggers include 'CPM', 'connectome predictive modeling', 'functional connectivity prediction', 'positive network', 'negative network', and 'edge selection'.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the CPM Skill skill

What this skill tells your AI

The instructions your AI receives, as published by cuhk-aim-group/neurodiscovery in skills/cpm/SKILL.md and read by ahel’s review.

Overview

cpm is the canonical NeuroClaw implementation of Connectome Predictive Modeling. Edge selection is repeated independently inside every training fold.

TaskInputOutput
Classificationsubject FC matrices/vectorsclass and probability
Regressionsubject FC matrices/vectorscontinuous prediction

Installation

pip install numpy pandas scipy scikit-learn joblib

Workflows

1. Prepare data

connectomes.npz:

X:          [subjects, nodes, nodes] or [subjects, edges]
subject_id: [subjects]

labels.csv contains the same subject IDs and a target column.

2. Regression

python skills/cpm/scripts/train_reference.py \
  --connectomes connectomes.npz \
  --labels labels.csv \
  --target cognitive_score \
  --subject-col subject_id \
  --task regression \
  --p-threshold 0.01 \
  --folds 5 \
  --output-dir run_models_output/cpm

3. Classification

python skills/cpm/scripts/train_reference.py \
  --connectomes connectomes.npz \
  --labels labels.csv \
  --target diagnosis \
  --task classification \
  --p-threshold 0.01 \
  --output-dir run_models_output/cpm_classification

If p-threshold is tuned, use nested validation or training-only selection.


Input / Output Summary

ItemFormat
Connectomes.npz with X, subject_id
LabelsCSV keyed by subject ID
Predictionspredictions.csv
Fold membershipfold_assignments.csv
Metricsmetrics.json
Fold modelscheckpoint.joblib
Provenanceconfig.json, run_manifest.json

Testing

pytest models/tests/test_extended_models.py -q
python skills/cpm/scripts/train_reference.py --help

Directory Reference

models/cpm/
├── cpm.py              fold-local CPM estimator
└── train.py            cross-validated CLI

skills/cpm/
├── SKILL.md
└── scripts/train_reference.py

Reference

  • Finn et al. functional connectome fingerprinting and connectome-based prediction framework, Nature Neuroscience (2015).

Created At: 2026-07-29 HKT Last Updated At: 2026-07-29 HKT Author: chengwang96

Signals

GitHub stars
85
Forks
4
Last commit
Sep 2026

ahel recommends instead

Advanced
Catalog kind
skill
Gateway key
cpm-cuhk-aim-group
Source
github.com/cuhk-aim-group/neurodiscovery