question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ENH] ICA based on AJD (SOBI, AMUSE, NSS)

See original GitHub issue

While developing an extension of ICA to grouped data (as opposed to simply pooling data), we (@NiklasPfister & myself) also implemented a variety of related linear ICA algorithms. They are based on approximate joint matrix diagonalization and, as opposed to FastICA, do not rely on non-Gaussianity of the sources. In particular, the following ICA-algorithms are implemented for the right choice of parameters by our UwedgeICA sklearn transformer:

  • NSS-JS, NSS-TD-JD (NSS = non-stationarity in time or space) as well as
  • the popular SOBI (second-order) and its predecessor AMUSE

(references can be found in the paper below). Additionally, the CoroICA transformer implements confounding-robust extensions of those aforementioned methods.

We guess it should be quite doable to include those in sklearn as our current implementation is already sklearn flavoured and built upon the respective mixins, PEP8 compatible, and comes with examples and documentation. Also the sklearn examples available for FastICA could be easily adapted and extended to demo the different ICA variants.

We are raising the issue to get early feedback and gauge the interest — what do you think?

@GaelVaroquaux @agramfort

Get current implementation: pip install coroica.

from coroica import UwedgeICA
from coroica.utils import md_index
import numpy as np
from sklearn.decomposition import FastICA


np.random.seed(0)


# generate 2 sources with changing variance
S = np.random.randn(1000, 2) \
    * np.c_[np.sin(np.arange(1000) / 1000),
            np.cos(np.arange(1000) / 1000)]
A = np.random.randn(2, 2)
X = (A.dot(S.T)).T

# transformers
fastica = FastICA(random_state=0)
uwedgeica = UwedgeICA(partitionsize=50)

# fit both ICAs
fastica.fit(X)
uwedgeica.fit(X)

print(f'MD(A,V_fastica) = {md_index(A, fastica.components_):.2f}')
print(f'MD(A,V_uwedge) = {md_index(A, uwedgeica.V_):.2f}')

# yields:
# MD(A,V_fastica) = 0.04
# MD(A,V_uwedge) = 0.02

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
NiklasPfistercommented, Jan 9, 2020

Thanks for your input. We agree that SOBI is the most widely used and hence relevant addition to scikit-learn. In our current implementation all of the 4 mentioned ICAs are realized by the exact same code base but only with different parameter settings (this is because all methods jointly diagonalize different (auto)-covariance matrices). We would therefore propose to do the following:

  1. add SobiICA transformer to scikit-learn based on our current UwedgeICA implementation
  2. allow users to adjust Sobi parameters that specify the considered timelags
  3. additionally add to the documentation for which parameter settings Sobi reduces to AMUSE and NSS-variants.
  4. add example that uses both FastICA and SobiICA and illustrates the differences In our opinion keeping the code base close to our current implementation also eases future maintenance efforts.

If that sounds good to you we would start with a WIP-PR.

0reactions
GaelVaroquauxcommented, Jan 21, 2020

I’m excited. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

(PDF) A review of second‐order blind identification methods
Second‐order source separation (SOS) is a data analysis tool which can be used for revealing hidden structures in multivariate time series data or...
Read more >
Untitled
Farm-based maize silage digester, Ahange shakhsi farzad farzin, Cz 308 rifles ... Ashcroft eagle soar, Who we are what we do, Sule detektif...
Read more >
(PDF) ADVANCED COMPONENT ANALYSIS TECHNIQUES FOR ...
Unlike blind 14 2. Fundamentals of Blind Source Separation source separation methods based on independent component analysis (ICA), here we do not assume...
Read more >
U5L1-Spell-Checker.xml - The Beauty and Joy of Computing
Recursively sort the rest of the list, then insert the one left-over item ... ,social,open,possible,side,play,means,needs,try,came,ca,based,hard,thought ...
Read more >
perform separate functions: Topics by Science.gov
With the advent of satellite-based surveillance, aircraft equipped with the ... Enhancement of fine particle (PM2.5) separation is important for cyclone ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found