Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds tests for channel selection. I also confirmed that it is working online.
To test online, use real or mock EEG data and an instance of Bessy Unity (I used MI), run mi_unity_backend.py and confirm that after training, when you hit "s" and python does its classification it says in the terminal "bci_essentials.classification.mi_classifier : The shape of X is (11, 4, 512)" where the middle number is the number of channels in the optimal subset (in this case 4). You can tell what is the best subset by the terminal output when record_performance = True. You should see a table printed which shows the subsets and their accuracies. For example in the following table, OzP4PO8Pz, is the best subset, so there are 4 channels in the optimal subset.
Step Time N Channels Channel Subset Unique Combinations Tested in Step Accuracy Precision Recall
1 1 0.256476 1 Oz 8 0.651685 0.651685 0.651685
2 2 0.512817 2 OzP4 7 0.715356 0.715356 0.715356
3 3 0.795229 3 OzP4Pz 6 0.704120 0.704120 0.704120
4 4 1.081679 4 OzP4PO8Pz 5 0.865169 0.865169 0.865169