treder / MVPA-Light

Matlab toolbox for classification and regression of multi-dimensional data
MIT License
70 stars 35 forks source link

Let classes have any numbering ... #5

Closed gdemarchi closed 5 years ago

gdemarchi commented 5 years ago

... instead of 1,2,3,4 ... Hi, I find quite useful since all of my classes come from MEG/EEG trigger values, which are not necessarily coded as 1,2,3,4 etc ... in the mvpa-ligtht stand alone i had a small script for fixing the numbers before going the the respective mv_ functions, but for the fieldtrip-esque way, i.e. to use the cfg.design info, I find more useful to pass directly cfg.design=data.trialinfo. data be could coming e.g. from a ft_selectdata round where I kept only the triggers 2, 20, 200 but mv_check_inputs wrongly could think (with nclasses = max(clabel)) that I have 200 classes :-) Feel free to modify/reject ... I tried 2 minutes to make it with one liner, but then the kids started jumping on the computer and my hacking time was over ... :-(

treder commented 5 years ago

Thanks! as said it's a good fix. There was a little problem (eg it wouldn't work if your clabel is -1's and 1's since everything would become 1's) so I had to amend the code a bit.

gdemarchi commented 5 years ago

Thanks!

As I use the numbers now, either directly as design matrix or trigger values coming from data.trialinfo, I don’t think i will ever get a -1, but who know how people are coding their stuff … Thanks, -g

On 11.03.2019, at 13:48, Matthias Treder notifications@github.com wrote:

Thanks! as said it's a good fix. There was a little problem (eg it wouldn't work if your clabel is -1's and 1's since everything would become 1's) so I had to amend the code a bit.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

treder commented 5 years ago

Yes indeed, thanks again for raising this. Bw, Matthias