diff --git a/docs/source/code/usage.py b/docs/source/code/usage.py index 2443006..759b1a9 100644 --- a/docs/source/code/usage.py +++ b/docs/source/code/usage.py @@ -2,7 +2,7 @@ V = nimfa.examples.medulloblastoma.read(normalize=True) -lsnmf = nimfa.Lsnmf(V, seed='random_c', rank=50, max_iter=100) +lsnmf = nimfa.Lsnmf(V, seed='random_vcol', rank=50, max_iter=100) lsnmf_fit = lsnmf() print('Rss: %5.4f' % lsnmf_fit.fit.rss()) diff --git a/nimfa/examples/medulloblastoma.py b/nimfa/examples/medulloblastoma.py index 1c16638..d4a1bec 100644 --- a/nimfa/examples/medulloblastoma.py +++ b/nimfa/examples/medulloblastoma.py @@ -182,7 +182,7 @@ def reorder(C): return C[:, ivl][ivl, :] -def read(): +def read(normalize=False): """ Read the medulloblastoma gene expression data. The matrix's shape is 5893 (genes) x 34 (samples). It contains only positive data. @@ -191,6 +191,8 @@ def read(): """ fname = join(dirname(dirname(abspath(__file__))), 'datasets', 'Medulloblastoma', 'Medulloblastoma_data.txt') V = np.loadtxt(fname) + if normalize: + V = (V - V.min()) / (V.max() - V.min()) return V