Last active
August 29, 2015 13:56
-
-
Save dengemann/9091092 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Denis A. Engemann <d.engemann@fz-juelich.de> | |
# | |
# License: BSD (3-clause) | |
""" Profile FastICA options | |
Dependencies | |
------------ | |
scikit-learn | |
https://github.com/fabianp/memory_profiler | |
Usage | |
----- | |
mprof run --python run_fast_ica.py | |
mprof plot | |
""" | |
import numpy as np | |
n_samples = 1e6/4 | |
n_features = 250 | |
rng = np.random.RandomState(42) | |
W = rng.random_sample([n_features, n_features]) | |
X = rng.random_sample([n_samples, n_features]) | |
print 'estimated data size in memory' | |
print '%i MB' % (X.size * X.itemsize / 1e6) | |
print '%s' % X.dtype | |
from sklearn.decomposition import FastICA | |
with profile.timestamp('FastICA-SVD-false'): | |
est = FastICA(n_components=50, whiten=True, svd_decorr=False) | |
est.fit(X) | |
with profile.timestamp('FastICA-SVD-true'): | |
est = FastICA(n_components=50, whiten=True, svd_decorr=True) | |
est.fit(X) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment