This github repository includes a walk-through example to help people get hands-on experience of using CANLab MVPA tools. This github is coupled with this hackpad.
You can download the CANLab core tools (written in MATLAB) using the following command line. You can also fork the CanlabCore repository.
$ git clone https://github.com/canlab/CanlabCore.git
You can also download this SAS2015_PatRec github repository using the following command line.
$ git clone https://github.com/wanirepo/SAS2015_PatRec.git
The main MATLAB function we will use for our purpose is fmri_data.predict
, which is a method of the fmri_data
object. You can read a brief overview of our object-oriented tools for fMRI analysis here. (We're sorry that documentations in that page are incomplete, but you will be able to get all the information you need for our purpose).
This object is a child of the image_vector
object. fmri_data
stores 4-D data from a series of one or more images. It has special data fields for predictors, outcome data, and other associated information. It inherits all the methods from image_vector
(e.g., fmri_data.orthviews
), but also has special methods for data analysis, including fmri_data.predict
, fmri_data.preprocess
, fmri_data.rescale
, and others.
Using this function, you will be able to run many different machine learning algorithms on your data. The algorithms include multiple regression, LASSO regression, LASSO-PCR, SVMs, SVR, etc. To run all of these algorithms, you may need basic MATLAB toolboxes provided by MathWorks. In addition, you need a couple of external toolboxes (see dependency below).
Our core toolbox has these external toolboxes within a directory called "External", and you can also download them from their website directly.
http://people.kyb.tuebingen.mpg.de/spider/download_frames.html
http://www.stat.berkeley.edu/~yugroup/downloads/
If you downloaded this, please change lasso.m
into lasso_rocha.m
. to avoid a name conflict with the lasso function provided by MathWorks.
For your note, our fmri_data.predict
has both options for Rocha and Zhao's lasso function ('cv_lassopcr') and MATLAB lasso function ('cv_lassopcrmatlab'). This is because we started to use lasso methods before MATLAB provided the lasso function. You can use one of them.
predict_example.m has all the codes you need for the hands-on experience. The output figures and detailed explanations can be found here.