[FieldTrip] error message when using dml.crossvalidator with "resample" option

Eelke Spaak eelke.spaak at donders.ru.nl
Fri Jul 4 09:31:07 CEST 2014


Dear Akiko,

You should not specify an instance of dml.crossvalidator as the
cfg.mva. Instead, ft_statistics_crossvalidate (which is called by
timelock/freqstatistics) will construct its own dml.crossvalidator,
wrapping whichever analysis you specify in cfg.mva. So, in your case,
this would result in a crossvalidator wrapping another crossvalidator,
leading to the error (since crossvalidator does not specify a test()
function).

Considering this problem, it used to be impossible to specify
resample=true when using dml with FieldTrip. However, I have just
committed a minor change to the code which allows you to specify
cfg.resample = true/false in the call to ft_freq/timelockstatistics.

So in your case you would specify:
cfg.mva = {dml.standardizer() dml.svm()};
cfg.resample = true;

The change is available on SVN and will be in tonight's FTP release.

Best,
Eelke

On 3 July 2014 20:11, Akiko Ikkai <akiko.ikkai at gmail.com> wrote:
> Dear Fieldtrippers,
>
> I'm trying to run a multivariate analysis to see if my data could classify
> trial types correctly. I'd like to use 'resample' option in
> dml.crossvalidator, since number of trials are sometimes quite different
> between trial types.
>
> When I feed in cfg.mva (at the end of this message), I get an error message:
> "No appropriate method, property, or field test for class
> dml.crossvalidator.
>
> Error in dml.analysis/test (line 65)
>                 Y = obj.method{c}.test(Y);
>
> Error in dml.crossvalidator/train (line 159)
>             obj.result{f} = tproc.test(testX);"
>
>
> I think it's because the inputs to dml.crossvalidator are not properly
> entered. Could someone suggest a good way to format the inputs?
>
> Here is what I'm running:
> cfg=[]; % perform classification on the two TFRs
> cfg.channel = 'Fp1';
> cfg.frequency = [4 8];
> cfg.latency = [.4 4.6];
> cfg.method='crossvalidate';
> cfg.design=[ones(size(TFRcond1.powspctrm,1), 1);
> 2.*ones(size(TFRcond2.powspctrm,1), 1)]';
> cfg.statistic = {'accuracy' 'binomial' 'contingency'};
> cfg.mva = dml.crossvalidator('mva',{dml.standardizer()
> dml.svm()},'resample',true);
> stat=ft_freqstatistics(cfg, TFRcond1, TFRcond2);
>
> Thanks in advance!
> Akiko
>
> --
> Akiko Ikkai, Ph.D.
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



More information about the fieldtrip mailing list