GithubHelp home page GithubHelp logo

megmvpa's Introduction

MEG MVPA Tutorial (Python & Matlab)

This tutorial accompanies the paper Multivariate pattern analysis for MEG: a comparison of dissimilarity measures.

Citation: Guggenmos, M., Sterzer, P., & Cichy, R. M. (2018). Multivariate pattern analysis for MEG: a comparison of dissimilarity measures. NeuroImage. DOI: 10.1016/j.neuroimage.2018.02.044

Python tutorial

Preparation

This tutorial is based on IPython/Jupyter Notebook files, which are linked below. In addition, the tutorial can be downloaded as a zip file, which includes the notebook files, additional code files and the example dataset used for this tutorial. To reduce computational costs, the dataset is for one participant only and includes only 9 of 92 experimental conditions.

Content of the zip file:

File Description
cv.py containing code for pseudo-trials/permutations/cross-validation
dissimilarity.py containing a number of custom dissimilarity measures
weird.py weighted robust distance classifier (WeiRD), see also here
python_decoding.ipynb Notebook on Decoding
python_reliability.ipynb Notebook on RDMs and Reliability
python_distance.ipynb Notebook on Distance measures and cross-validation
data01_sess1.npy data for subject 1, session 1
data01_sess2.npy data for subject 1, session 2
labels01_sess1.npy trial labels for subject 1, session 1
labels01_sess2.npy trial labels for subject 1, session 2

In addition, the tutorial requires 4 established scientific python packages: numpy, scipy, scikit-learn, matplotlib

List of tutorials:

Matlab tutorial

Preparation

This tutorial is based on IPython/Jupyter Notebook files, which are linked below. In addition, the tutorial can be downloaded as a zip file, which includes the notebook files, additional code files and the example dataset used for this tutorial. To reduce computational costs, the dataset is for one participant only and includes only 9 of 92 experimental conditions.

Content of the zip file:

File Description
cov1para.m Shrinkage code (Ledoit & Wolf, 2004) for covariances
weirdtrain.m & weirdpredict.m Weighted Robust Distance (WeiRD) classifier
gnbtrain.m & gnbpredict.m Gaussian Naive Bayes (GNB) classifier
matlab_decoding.ipynb Notebook on Decoding
matlab_reliability.ipynb Notebook on RDMs and Reliability
matlab_distance.ipynb Notebook on Distance measures and cross-validation
data01_sess1.mat data for subject 1, session 1
data01_sess2.mat data for subject 1, session 2
labels01_sess1.mat trial labels for subject 1, session 1
labels01_sess2.mat trial labels for subject 1, session 2

In addition, the tutorial assumes a working LIBSVM installation for Matlab.

List of tutorials:

megmvpa's People

Contributors

m-guggenmos avatar

Stargazers

jiangyou avatar HH Chen avatar Jonathan Hils avatar Ladislas Nalborczyk avatar Daniel Anthes avatar Xianhui He avatar Alicia avatar  avatar finch avatar Haley Keglovits avatar Siying Xie avatar Bati Yilmaz avatar Ata Karagoz avatar  avatar Hause Lin avatar Jixing Li avatar Jessica Loke avatar Máté Aller avatar Marijn van Vliet avatar Martina G. Vilas avatar Kanyin_Feng avatar Daniel Lindh avatar Peer Herholz avatar Elizaveta Genke avatar Tijl Grootswagers avatar N. Seydel avatar Avraam "Makis" Marimpis avatar  avatar

Watchers

 avatar James Cloos avatar Bati Yilmaz avatar

megmvpa's Issues

Question about cross-validated correlation distance

Hello, thanks for making this code available! I'm working to replicate your distance notebook with some of our own data and in looking through the definition for the cross validated correlation I see that the denominator is sometimes the square root of covariances, which is not guaranteed to be positive (ie if train and test set have negative covariance, that calculation would fail). If regularize_var is set to true (which you have) this won't be an issue because of the max function, but I'm wondering if you have suggestions for the case when there is negative covariance between data splits? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.