bbci / bbci_public

MATLAB toolbox for Brain-Computer Interfacing (BCI)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

loss_classwiseNormalized warning in case of small test sets

BenjaminBlankertz opened this issue · comments

If the function loss_classwiseNormalized is called without optional argument to specific the ratio of the sizes of the two class, it is estimated from the (test) data (because the loss function does not have access to the training data). In case of small test data, this estimate might be bad (unless you have a stratified test set) and lead to bad estimated of the generalization loss.

Therefore, in this case a warning should be given. It could be insert where the test of one class being empty is performed:
if any(not(N)) % problem when any(N==0)