All Projects → lukassnoek → Mvca

lukassnoek / Mvca

Licence: mit
Code for simulations and empirical analyses for the article "How to control for confounds in decoding analyses of neuroimaging data"

Projects that are alternatives of or similar to Mvca

Gym Blender
Blender Environment for Gym (work in progress)
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Snake
Code for "Deep Snake for Real-Time Instance Segmentation" CVPR 2020 oral
Stars: ✭ 849 (+9333.33%)
Mutual labels:  jupyter-notebook
100days
100 days of algorithms
Stars: ✭ 6,789 (+75333.33%)
Mutual labels:  jupyter-notebook
Uw python for geosciences
Talks from the UW Python for Geosciences Seminar
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Swcarpentry Workshop Pandas
Remix of Software Carpentry material using intermediate pandas lesson and concepts from the novice class
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Jupyter Notebooks
data analysis experiments in haskell and python
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Kaggle right whale
Project on Pattern Detection and Recognition using Deep Learning
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Finance
Stars: ✭ 9 (+0%)
Mutual labels:  jupyter-notebook
Machine Learning Experiments
🤖 Interactive Machine Learning experiments: 🏋️models training + 🎨models demo
Stars: ✭ 841 (+9244.44%)
Mutual labels:  jupyter-notebook
Code snippets
No description, website, or topics provided.
Stars: ✭ 8,186 (+90855.56%)
Mutual labels:  jupyter-notebook
Spot price history
IPython notebook that uses Boto, Pandas and MatPlotLib to show historical price data
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Dominhhai.github.io
My Blog
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Pelee
Pelee: A Real-Time Object Detection System on Mobile Devices
Stars: ✭ 851 (+9355.56%)
Mutual labels:  jupyter-notebook
Musicinformationretrieval.com
Instructional notebooks on music information retrieval.
Stars: ✭ 845 (+9288.89%)
Mutual labels:  jupyter-notebook
Nlp course
YSDA course in Natural Language Processing
Stars: ✭ 7,523 (+83488.89%)
Mutual labels:  jupyter-notebook
Buoypy
Retrieve NDBC data
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Poems
Poems (Mirror)
Stars: ✭ 8 (-11.11%)
Mutual labels:  jupyter-notebook
Socialgraphs2017
This is the repo associated with the class 02805 "Social Graphs and Interactions" at the Technical University of Denmark
Stars: ✭ 9 (+0%)
Mutual labels:  jupyter-notebook
Syntree2vec
An algorithm to augment syntactic hierarchy into word embeddings
Stars: ✭ 9 (+0%)
Mutual labels:  jupyter-notebook
Light head rcnn
Light-Head R-CNN
Stars: ✭ 852 (+9366.67%)
Mutual labels:  jupyter-notebook

How to control for confounds in decoding analyses of neuroimaging data ("MultiVoxel Confound Analysis", MVCA)

Code for simulations and empirical analyses for our article on dealing with confounds in decoding analyses of neuroimaging data. The data (preprocessed VBM/TBSS arrays) can be downloaded using the download_data.py script.

We've implemented the (cross-validated) confound regression procedure as a scikit-learn-style "transformer" class, which is implemented in the skbold package. To use it, install skbold (from master) and import it as follows: from skbold.preproc import ConfoundRegressor.

NEW: we also uploaded the source code for the ConfoundRegressor object in this repository at analyses/confounds.py, so no need to install skbold (feel free to use/modify/adapt/etc).

A minimal example on how to use it is outlined below:

import numpy as np
from skbold.preproc import ConfoundRegressor

data = np.random.normal(0, 1, size=(100, 2))

# X = neuroimaging data (N x K array), C = confound (N x P array, for P confound variables)
X, C = data[:, 0, np.newaxis], data[:, 1]
X_train, X_test = X[::2, :], X[1::2, :]

cfr = ConfoundRegressor(confound=C, X=X)
X_train_corr = cfr.fit_transform(X_train)
X_test_corr = cfr.transform(X_test)

# X_train_corr and X_test_corr represent the data corrected for the confound

The ConfoundRegressor class also works with scikit-learn pipelines!

import numpy as np
from skbold.preproc import ConfoundRegressor
from sklearn.pipeline import make_pipeline
from sklearn.svm import SVC
from sklearn.model_selection import cross_val_score

data = np.random.normal(0, 1, size=(100, 2))

# X = neuroimaging data (N x K array), C = confound (N x P array, for P confound variables)
X, C = data[:, 0, np.newaxis], data[:, 1]
y = np.repeat([0, 1], repeats=50)

cfr = ConfoundRegressor(confound=C, X=X)
clf = SVC(kernel='linear')
pipeline = make_pipeline(cfr, clf)

scores = cross_val_score(estimator=pipeline, X=X, y=y, cv=10)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].