WIP, ENH: Avoid ICA on rank-deficient data #8316
Closed
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.
ICA.max_pca_components
can now be set torank
to limit the number of components to the rank the data.None
, is still an accepted, but deprecated.None
, too, now dictates to use the rank of the data. Previously, it implied to use the number of channels, which caused problems with rank-deficient data.compute_rank()
and_estimate_rank_meeg_signals()
have gained aref_meg=False
kwarg to allow for rank calculation to include MEG reference channels. This was required to make some tests work.Implementing this helped discover a few existing test cases that never converged because they fed rank-deficient data to ICA.
Closes #8313.
I need help:
mne/viz/tests/test_ica.py::test_plot_ica_overlay
doesn't pass because of Accessing data after applying gradient compensation & picking doesn't work #8315mne/preprocessing/tests/test_ica.py::test_ica_full_data_recovery
doesn't pass because the difference between actual and expected test results is too large. It's still rather small but larger than the predefined limits. I have no idea why that is the case, and whether it might be safe to just make the test more lenient or not.