Confound-Corrected Connectome-based Predictive Modeling Python Package
Project description
Confound-Corrected Connectome-Based Predictive Modelling in Python
Confound-Corrected Connectome-Based Predictive Modelling is a Python package for performing connectome-based predictive modeling (CPM). This toolbox is designed for researchers in neuroscience and psychiatry, providing robust methods for building predictive models based on structural or functional connectome data. It emphasizes replicability, interpretability, and flexibility, making it a valuable tool for analyzing brain connectivity and its relationship to behavior or clinical outcomes.
What is Connectome-Based Predictive Modeling?
Connectome-based predictive modeling (CPM) is a machine learning framework that leverages the brain's connectivity patterns to predict individual differences in behavior, cognition, or clinical status. By identifying key edges in the connectome, CPM creates models that link connectivity metrics with target variables (e.g., clinical scores). This approach is particularly suited for studying complex relationships in neuroimaging data and developing interpretable predictive models.
Key Features
- Univariate Edge Selection: Supports methods like
pearson,spearman, and their partial correlation counterparts, with options for p-threshold optimization and FDR correction. - Cross-Validation: Implements nested cross-validation for robust model evaluation.
- Edge Stability: Selects stable edges across folds to improve model reliability.
- Confound Adjustment: Controls for covariates during edge selection and modeling.
- Permutation Testing: Assesses the statistical significance of models using robust permutation-based methods.
Documentation
For detailed instructions on installation, usage, and advanced configurations, visit the documentation website.
Installation
Install the package from GitHub:
git clone https://github.com/mmll/confound_corrected_cpm.git
cd cpm_python
pip install .
Quick Example
Here's a quick overview of how to run a CPM analysis:
from cccpm.cpm_analysis import CPMRegression
from cccpm.edge_selection import UnivariateEdgeSelection, PThreshold
from sklearn.model_selection import KFold
# Configure edge selection
univariate_edge_selection = UnivariateEdgeSelection(
edge_statistic=["pearson"],
edge_selection=[PThreshold(threshold=[0.05], correction=["fdr_by"])]
)
# Create the CPMRegression object
cpm = CPMRegression(
results_directory="results/",
cv=KFold(n_splits=10, shuffle=True, random_state=42),
edge_selection=univariate_edge_selection,
n_permutations=100
)
# Run the analysis
X = ... # Connectome data
y = ... # Target variable
covariates = ... # Covariates
cpm.run(X, y, covariates)
Contributing
Contributions are welcome! If you have ideas, feedback, or feature requests, feel free to open an issue or submit a pull request on the GitHub repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cccpm-0.1.1.tar.gz.
File metadata
- Download URL: cccpm-0.1.1.tar.gz
- Upload date:
- Size: 39.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4786dcbb169b365755f5fa50ff8dacda8db78cb4e33307b99745c8d8bd3d8a2f
|
|
| MD5 |
4ccee480b533263f9e92a3722a016b0f
|
|
| BLAKE2b-256 |
6aac0d10e8b80b73c3be8de08891c2b1532fc96fa054763caad64276d218c5d1
|
Provenance
The following attestation bundles were made for cccpm-0.1.1.tar.gz:
Publisher:
publish.yml on wwu-mmll/confound_corrected_cpm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cccpm-0.1.1.tar.gz -
Subject digest:
4786dcbb169b365755f5fa50ff8dacda8db78cb4e33307b99745c8d8bd3d8a2f - Sigstore transparency entry: 798324921
- Sigstore integration time:
-
Permalink:
wwu-mmll/confound_corrected_cpm@d7796179c561d30653bb1628e8bca3172c585674 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wwu-mmll
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7796179c561d30653bb1628e8bca3172c585674 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cccpm-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cccpm-0.1.1-py3-none-any.whl
- Upload date:
- Size: 44.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89f994ec9a1cac8b2cbaeb1ccbc6c97c392ddee9d8ed35f95cb6dd035697ba0f
|
|
| MD5 |
38bb9f95450a7ee6fb5d26e657052d0d
|
|
| BLAKE2b-256 |
56e0b8167b6ca45db68dfb9a4286ad0b91fb50826f8e912361bc9c84bd2e645d
|
Provenance
The following attestation bundles were made for cccpm-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on wwu-mmll/confound_corrected_cpm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cccpm-0.1.1-py3-none-any.whl -
Subject digest:
89f994ec9a1cac8b2cbaeb1ccbc6c97c392ddee9d8ed35f95cb6dd035697ba0f - Sigstore transparency entry: 798324923
- Sigstore integration time:
-
Permalink:
wwu-mmll/confound_corrected_cpm@d7796179c561d30653bb1628e8bca3172c585674 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wwu-mmll
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7796179c561d30653bb1628e8bca3172c585674 -
Trigger Event:
push
-
Statement type: