Decoding Averaged Epochs

Hi everyone,

I have been able to use Decoding with Matlab SVM successfully with my individual ERP epochs trials in BrainStorm. This is an excellent feature- so thank you to the developers! :slight_smile:

However I would also like to run decoding on averaged epochs and keep receiving this error message:
Could anyone please advise how to resolve this or if you have been successful with using decoding on averaged epochs in brainstorm?


How many of these averages do you have for each of your conditions?

@pantazis @MartinC: Are you familiar with this error?

Hi Francois,
10 exemplars, which have resulted from averaged epochs. Two conditions, with 10 in one and 10 in the other.

I found one way to reproduce the issue. If one of the sensors you included for decoding has zero values, there is a potential division by zero that happens when applying the baseline before decoding. As soon as a single sensor has a NaN value, the decoder fails. I've pushed a simple fix that ensures no divison by zero can occur when applying the baseline:

This is not related to averaging epochs however, so this might not be what was causing your issue. Note that I am not sure it makes sense to decode using averages since the decoding process already uses kfolding (averaging epochs in random groups).