Skip to content

Add 5 new SSVEP classifiers and fix label handling#1009

Merged
bruAristimunha merged 10 commits intodevelopfrom
feature/add-ssvep-classifiers
Mar 1, 2026
Merged

Add 5 new SSVEP classifiers and fix label handling#1009
bruAristimunha merged 10 commits intodevelopfrom
feature/add-ssvep-classifiers

Conversation

@bruAristimunha
Copy link
Copy Markdown
Collaborator

Summary

  • Add 5 new SSVEP classifiers: SSVEP_itCCA, SSVEP_eCCA, SSVEP_TRCA_R, SSVEP_SSCOR, SSVEP_TDCA
  • Fix critical label mismatch in all SSVEP classifiers (CCA, TRCA, MsetCCA + new ones)
  • Fix filterbank numerical stability (SOS form, capped filter order)
  • Fix np.reshape deprecation in ssvep_nakanishi.py and ssvep_wang.py

Label handling fix

All SSVEP classifiers (except MsetCCA) used X.event_id.keys() to get class labels, which returned generic integer strings ('1', '2', ...) instead of actual frequency labels from y ('9.25', '9.75', ...). This caused:

  1. Wrong sinusoidal reference frequencies (e.g., 1 Hz instead of 9.25 Hz)
  2. Wrong filterbank peak frequencies
  3. Label encoding mismatch between classifier predictions and evaluation y labels

Now all classifiers use np.unique(y) and boolean masking for epoch selection. The benchmark also passes mne_labels=True for epoch-based pipelines.

Benchmark results (Nakanishi2015, WithinSession, 12-class)

Pipeline Before After
CCA 10.0% 92.5%
itCCA ~8.3% 98.0%
eCCA ~8.3% 99.4%
MsetCCA 43.2% 43.2%
TRCA ~8.3% 86.3%
TRCA-R ~8.3% 99.3%
SSCOR ~8.3% 99.2%
TDCA ~8.3% 99.0%

Test plan

  • All 32 classification tests pass (20 passed + 12 xpassed)
  • WithinSession benchmark on Nakanishi2015 verified
  • CI checks

…lines

Add SSVEP_itCCA, SSVEP_eCCA, SSVEP_TRCA_R, SSVEP_SSCOR, and SSVEP_TDCA
classifiers with pipeline YAML configs, benchmark registration, and tests.

Fix critical label mismatch in all SSVEP classifiers: previously used
X.event_id.keys() which returned generic integer strings ('1','2',...)
instead of actual frequency labels from y ('9.25','9.75',...). This caused
wrong sinusoidal reference frequencies, wrong filterbank peaks, and
prediction/evaluation label mismatches. Now all classifiers use np.unique(y)
and boolean masking for epoch selection, matching MsetCCA's correct pattern.

Also fix filterbank numerical stability (SOS form, capped filter order)
and np.reshape deprecation in ssvep_nakanishi.py and ssvep_wang.py.
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@bruAristimunha bruAristimunha merged commit add075d into develop Mar 1, 2026
11 of 12 checks passed
@bruAristimunha bruAristimunha deleted the feature/add-ssvep-classifiers branch March 2, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant