mne-tools / mne-tools/mne-python

Add ICA.pca_explained_variance_ratio_

Open
#8,322 15 comments 1 reaction 1 assignee View on GitHub

@hoechenberger is already working on this.

Since Oct 18, 2020.

ENH
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Describe the problem

When using ICA.max_pca_components to reduce data dimensionality before ICA, after fitting we have ICA.pca_explained_variance_ containing the absolute variances of all retained principal components. However, it's impossible to reconstruct how much of the total variance before dimensionality reduction (i.e., leaving out PCs) each PC explained.

Describe your solution

The _PCA object has an attribute explained_variance_ratio_, which holds the individual value explained variance relative to all principal components, before leaving some out. We should expose these values after an ICA fit as ICA.pca_explained_variance_ratio_, so users can find out post-hoc just how much variance of the original data their PCA/ICA approach actually explains.

Describe possible alternatives

We could retain the variances of all components, not only those which were kept. But I don't like this idea: If I decide to keep 30 PCs, I want the ICA.pca_explained_variance_ vector to be precisely 30 elements long.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.