Open jsosulski opened 3 years ago
Yes, this is a step toward evaluations that are closer to real use of BCI, with online setting. It could be an issue for within-session evaluation, but there is no problem for cross-session/cross-subject evaluation. Within-session evaluation relies on 5-fold cross-validation, are you suggesting to switch to a single train-test split or to a something like a group k-fold?
GroupKFold
would be the ideal when we have meaningful segmentation between parts of the experiment, e.g., one stimulation sequence to detect a new letter. However, in the absence of this information for each dataset - and If I understand StratifiedKFold
correctly - we could also just set shuffle=False
in the crossvalidation call?
I just found out about TimeSeriesSplit
which sounds interesting, as it both allows plotting of kind of a learning curve as well as reflect an online BCI setup. See this plot from the sklearn docs:
Currently, moabb stratifies and picks random samples from X for training (T)/validation (V) respectively. A simple assignment vector could look like this:
Especially in ERP datasets, when successive epochs are overlapping, this way of sampling will lead to statistical information (e.g. signal mean and signal covariance) leaking between train and test epochs. There are two ways to mitigate this issue:
Then we would have a possible leak from train to validation epochs at only one intersection between train / validation label assignments.
Doing this will probably reduce average performances achieved with all classifier types, however, less so for classifiers that have better generalization properties.