Confound-Corrected CPM
activeA Python toolbox for connectome-based predictive modeling with rigorous confound correction, nested cross-validation, and permutation-based significance testing.
Connectome-based predictive modeling (CPM) links brain connectivity patterns to individual differences in behavior, cognition, or clinical status. It is widely used in neuroimaging research — but most implementations do not rigorously handle confounds, which can produce inflated or spurious predictions. This toolbox was built to close that gap.
What it does
Confound-Corrected CPM implements a full CPM workflow with confound control as a first-class feature, not an afterthought. Confounds can be regressed out at the edge-selection stage, the modeling stage, or both — depending on the analysis question. The package is designed for reproducibility, with results saved in a structured format for downstream inspection.
Key features:
- Univariate edge selection — Pearson, Spearman, and partial correlation variants with p-threshold optimization and FDR correction
- Confound adjustment — covariate control during edge selection and model training
- Nested cross-validation — robust performance estimation that avoids overfitting to the evaluation procedure
- Edge stability — selects only edges that appear consistently across folds, improving reliability
- Permutation testing — assesses statistical significance of final models without parametric assumptions
Background
This toolbox accompanies our 2025 paper in Neuroscience Applied evaluating different strategies for controlling confounds in CPM. The paper showed that the choice of confound correction strategy meaningfully affects model performance and interpretation — motivating a flexible implementation that lets researchers explicitly control that decision.