sccn / BCILAB

MATLAB Toolbox for Brain-Computer Interface Research
Other
198 stars 120 forks source link

Help: ml_trainsvm error, 'The formats of all prediction arrays to concatenate need to be identical' #70

Open KevMat18304 opened 4 years ago

KevMat18304 commented 4 years ago

Hi BCILAB,

I am trying to utilize the machine learning algorithm SVM. I chose the 'crammer' variant where I want to create a multi-class predictor that can decide between four motorimagery classes: "Left hand", "right hand", "left foot", and "right foot"; I ran the training script and got this error: "The Formats of all prediciton arrays to concatenate need to be identical". I am stumped, can someone help explain what I am doing wrong? and, what can I change?

Best, KevMat

EmileDeBiot commented 3 months ago

Hi KevMat,

I feel the response is a bit late for you but maybe it will be useful for others.

I had the same problem using a different approach (different model: FBCSP and preprocessing). The solution I found is to add markers from the class that is less represented in your target markers. I feel this error occurs if there are not enough predictions for one type of target (maybe when computing mis-classification). I haven't dug to much to find why there is an error, but maybe this solution is enough <3

Best, Emile.