The API reference of CSP needs update

This week, I upgraded my MNE env from V 1.5.1 to 1.7.1 and machine learning model report error. After check, I found the parameter ā€˜rankā€™ in decoding.CSP() no longer supports string value.
e.g.

csp = CSP(n_components=csp_componnets, reg=ā€˜empiricalā€™, log=True, cov_est=ā€˜concatā€™, transform_into=ā€˜average_powerā€™, norm_trace=False, rank=ā€˜fullā€™, component_order=ā€˜mutual_infoā€™)
csp.fit(X, y)

will cause

Traceback (most recent call last):
Cell In[87], line 1
csp.fit(X, y)

File E:\conda_env\mne\Lib\site-packages\mne\decoding\csp.py:196 in fit
_validate_type(self.rank, (dict, None), ā€œrankā€)

File E:\conda_env\mne\Lib\site-packages\mne\utils\check.py:613 in _validate_type
raise TypeError(

TypeError: rank must be an instance of dict or None, got <class ā€˜strā€™> instead.

Meanwhile, the API reference of CSP keeps same as before. mne.decoding.CSP ā€” MNE 1.7.1 documentation

Please update the API reference, so we can learn whatā€™s new, thanks.

  • MNE version: 1.7.1
  • operating system: win 10

This seems to be a bug, can you please open a new issue? Thanks!

I reported this here: CSP `rank` parameter does not behave as expected Ā· Issue #12784 Ā· mne-tools/mne-python Ā· GitHub

The problem has been fixed here: BUG: Fix bug with CSP rank="full" by larsoner Ā· Pull Request #12694 Ā· mne-tools/mne-python Ā· GitHub

When upgrading to the development version of mne, the behavior of CSP is as expected.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.