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)
Release files for npica 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| npica-0.0.1.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| npica-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / npica-0.0.1.tar.gz
| Download URL | npica-0.0.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b76fdad93038da9d048b05e560bee40d19d48eb0fac7c1930852d8d7191f2513
|
|
BLAKE2b-256 checksum How to use checksums |
0e828f842bdb61aacd267b4924c36e13452cda47fc7677b1b572753aea6df89b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / npica-0.0.1-py3-none-any.whl
| Download URL | npica-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95ffba64e28d5ac54b8fb65f3b46a258c008e0b7d6316f3c5109c3c90c19d096
|
|
BLAKE2b-256 checksum How to use checksums |
e5e82239144262cc9b431531a8cd8d2764adf7f8204a14cd7e6ed60786299968
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|