[FieldTrip] Error occurs when applying searchgrid for lambda in MVPA light toolbox

Herfurth, Kirsten Kirsten.Herfurth at uk-erlangen.de
Fri May 10 14:27:13 CEST 2019


Dear Sophie,

thanks a lot for your quick answer. The configuration I used is the following:

cfg = [] ;
cfg.method          = 'mvpa';
cfg.mvpa.classifier = 'logreg';
cfg.mvpa.metric     = 'accuracy';
cfg.mvpa.k          = 3;
cfg.mvpa.param.reg = 'l2';
cfg.mvpa.param.lambda = 'auto';
cfg.mvpa.param.plot = 1;
cfg.latency         = [0.5, 0.7];
cfg.avgovertime     = 'yes';
cfg.design          = [ones(nFIC,1); 2*ones(nFC,1);];
stat = ft_timelockstatistics(cfg, dataFIC_LP, dataFC_LP)

It seems to be important to write cfg.mvpa.param instead of cfg.param, otherwise it just ignores the L2 regularization and runs  ‘logf’ instead.

I hope you can replicate the error this way.

Thanks in advance, best,

Kirsten




Von: Arana, S.L. (Sophie) [mailto:S.Arana at donders.ru.nl]
Gesendet: Donnerstag, 9. Mai 2019 11:18
An: fieldtrip at science.ru.nl
Cc: Herfurth, Kirsten
Betreff: Re: Error occurs when applying searchgrid for lambda in MVPA light toolbox


Dear Kirsten,



I could not replicate your error with the MVPAlight toolbox. Could you post the code you used on the tutorial data that gave you the error?



Best,

Sophie​

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Herfurth, Kirsten <Kirsten.Herfurth at uk-erlangen.de>
Sent: Tuesday, May 7, 2019 1:08 PM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] Error occurs when applying searchgrid for lambda in MVPA light toolbox

Dear fieldtrip developers,

I’m extremely enthusiastic about the newly implemented MVPA light toolbox on fieldtrip, thanks a lot! I’m trying out logistic regression on my data and would like to do a search grid for lambda with cfg.mvpa.param.lambda = ‘auto’. However, I get the following error message in line 433 of train_logreg.m when calculating the gradient g = ((cfg.weights .* sigma)' * YX)'/N - sumyxN + lambda * w: matrix dimensions must agree.
If I just pass one value for lambda, it works fine.
The same error occurs with the tutorial data. Here, cfg.weights has a 100x1 dimension, and sigma is 80x1 in size. I’m using Matlab 2017b and the most recent fieldtrip 2019-04-19 version.

I don’t know where to fix this and would be very grateful for your help.

Best wishes,

Kirsten Herfurth

Post-Doc at the MEG-lab in Erlangen, Germany




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190510/1fe67ed8/attachment-0002.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list