decoding with unbalance design

Hi all, I have recently started learning how to decode using mne. Suppose my experiment has two conditions and 150 trials. Participants need to evaluate whether they feel the “AHA” during the each trial. I know that each participant needs to ensure that the number of times they feel “aha” is the same as the number of times they do not feel “aha” for decoding analysis. Is it necessary to ensure that all participants have the same number of “aha” when conducting the analysis?

Hello @weixing10423 and welcome to the forum!

You don’t need to have perfectly balanced classes (neither within, nor between participants) if the calculated performance score is the area under the ROC curve (“ROC AUC”). You can achieve this e.g. during time-by-time decoding by passing scoring='roc_auc' to the SlidingEstimator, as demonstrated in this tutorial example:

https://mne.tools/stable/auto_tutorials/machine-learning/50_decoding.html#decoding-over-time

Best wishes,

Richard

(post deleted by author)

Thank you very much for your reply, I was curious if the results would be affected if each participant had a different number of trials. At the same time, I was confused about how to do the group-analysis, and the tutorials all seemed to be for one participant.
Best wishes,
wx

No, this should not be the case unless the number of trials is very small.

I usually follow the common 2-level approach here: first, get some statistics for each individual participant, and then use these stats to perform a group analysis.

So: You first run decoding on each participant individually. To get the “group performance”, you can average the individual scores. In the same manner, you can also get the spread (e.g., SD or CI) for your group.

Best wishes,
Richard

Thank you very much for your kind help, it has helped me a lot!
Best wishes,
wx