UnfoldDecode - decoding several targets using the same encoding model? #329
Replies: 1 comment 1 reply
-
|
Hi!
This might be helpful in your situation. Do you have 60 event types, or a condition with 60 levels? I'm not super sure how common it is to have multiple targets. I'm somewhat hesitant as this will add a bit more complexity to a codebase that is not well tested yet. But maybe the changes necessary are not that large
Unfold.fit(UnfoldDecodingModel, design, tbl, dat::AbstractMatrix, model::MLJ.Model, target::Any;kwargs...) = fit(UnfoldDecodingModel,design,tbl,dat,model,Pair(target);kwargs...)(didnt test it) coincidentially I think I found a severe training-leakage bug: # XXX remove the boundary data to ensure no leakage
uf_train = Unfold.fit(
UnfoldLinearModelContinuousTime,
design,
tbl,
dat;
eventcolumn = eventcolumn,
unfold_fit_options...,
)tbl should be tbltrain I think. I also think this is not correct: it should better be MultiClass, not OrderedFactor. For 2-classes (my test cases) it doesnt matter, but in your case it might - or LDA ignores it. But other models might not. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi again,
In the UnfoldDecode fit-function one target can be decoded at a time. However, in our case we have up to 60 stimuli (kind of experimental conditions), all encoded with the same Unfold-model and with the same basisfunction, and we want to decode each one of them, i.e. have up to 60 targets.
So would it make sense to decode several targets in one UnfoldDecode.fit call, i.e. use the same Unfold-fit to decode all the intended targets instead of fitting a new encoding model for each target? So, after fitting the encoding model to the train and test sets in each fold all intended targets would be decoded for that fold using the same fitted models, before moving to the next fold. In that case the target argument should be changed to some kind of dict or array of pairs, and the returned UnfoldDecodingModel should be something like an array of vectors of DecodingFits..? Or is it indeed better to fit the encoding model separately for each target?
Sorry about the messy explanation, I hope you get what I mean...
And btw, is the target classified against all other categories (one vs. all) or in a pairwise manner (one vs. one)?
Also, in UnfoldDecode.fit the target variable is defined as Pair, which causes some problems when calling the function from Python. Is there a reason why the target should be defined as Pair instead of Tuple? The model seems to run either way.
Best, Riikka
Beta Was this translation helpful? Give feedback.
All reactions