A Python implementation of https://github.com/snormanhaignere/nonparametric-ica
Project description
Description
A Python implementation of the nonparametric decomposition described in:
Norman-Haignere SV, Kanwisher NG, McDermott JH (2015). Distinct cortical pathways for music and speech revealed by hypothesis-free voxel decomposition. Neuron.
Also see the repository for the original implementation.. From the README there:
The algorithm iteratively rotates the top K principal components of the data matrix, X, to maximize a measure of non-Gaussianity ('negentropy'). This procedure is closely related to standard algorithms for independent component analysis, but unlike standard algorithms does not depend on assumptions about the type of non-Gaussian distribution being identified. Because negentropy is estimated with a histogram, the algorithm tends to work well with a large number of data points (~10,000). The run-time of the algorithm increases substantially as the number of components is increased because the optimization is performed via a brute-force search over all pairs of components (run-time is thus proportional nchoosek(K,2) where K is the number of components).
Usage
import numpy as np
# Create synthetic data
M = 100 # number of features
N = 10000 # number of measures
K = 3 # number of components
R_true = np.random.rand(M,K)
W_true = np.random.exponential(scale = 1, size=(K,N))
X = R_true@W_true + .01*np.random.normal(M,N)
from npica import ICA
N_RANDOM_INITS = 10
RAND_SEED = 1
ica = ICA(K=K,N_RANDOM_INITS=N_RANDOM_INITS,RAND_SEED=RAND_SEED)
ica.fit(X)
print(ica.sources)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file npica-0.0.1.tar.gz.
File metadata
- Download URL: npica-0.0.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b76fdad93038da9d048b05e560bee40d19d48eb0fac7c1930852d8d7191f2513
|
|
| MD5 |
5ad5d4fb2811bc374b09f0c514b640ef
|
|
| BLAKE2b-256 |
0e828f842bdb61aacd267b4924c36e13452cda47fc7677b1b572753aea6df89b
|
File details
Details for the file npica-0.0.1-py3-none-any.whl.
File metadata
- Download URL: npica-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ffba64e28d5ac54b8fb65f3b46a258c008e0b7d6316f3c5109c3c90c19d096
|
|
| MD5 |
c2cf7eea961e0bd267241ec7e9ce741f
|
|
| BLAKE2b-256 |
e5e82239144262cc9b431531a8cd8d2764adf7f8204a14cd7e6ed60786299968
|