[FieldTrip] ft_timelockstatistics crossvalidate alternative

Es, M.W.J. van (Mats) M.vanEs at donders.ru.nl
Tue Sep 8 10:43:46 CEST 2015

Dear FieldTrippers,

For my master's project I am trying to classify my MEG data on the orientation of a grating-stimulus (presented for 1sec). I do this in a time-resolved manner so I get the classifier accuracy over time, which means I classify on 20ms windows and slide this window every 2.5ms. Up till now I used the cfg.method = 'crossvalidate' in ft_timelockstatistics (so, five fold crossvalidation). My question now is as follows:

instead of training on 80% of the trials and testing on 20% of the trials for the selected time window, I want to train the classifier on the whole second the stimulus is on-screen (except the selected time-window) and then test it on the selected timewindow. Moreover, i want to do this for two cases:
- independent for each trial. So for each trial train on the 1sec window (of only that trial) and test on the selected 20ms window (of that trial).
- for all trials together. Train on the 1sec window of all trials, test on the selected 20ms window of all trials.

So in short, I'm looking for a way to tell the classifier what to train on and what to test on.

For completeness, I'm using the latest fieldtrip on the torque cluster with matlab2015a.
after ft_timelockanalysis, I've been using the following code:
    cfg         = [];
    cfg.layout  = 'CTF275.lay';
    cfg.method  = 'crossvalidate';
    cfg.nfolds = 5;
    cfg.design  = [ones(size(counterclockwise.trial,1),1); 2*ones(size(clockwise.trial,1),1)]';
    cfg.latency     = [tBegin tBegin+0.02]; % 20ms window
    cfg.statistic = {'accuracy' 'binomial' 'contingency'};
    stat = ft_timelockstatistics(cfg,counterclockwise, clockwise);

Thank you for your help!
Mats van Es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150908/c60d874d/attachment-0001.html>

More information about the fieldtrip mailing list