Skip to content

Commit

Permalink
Re-added normalization to Medulloblastoma (needed in examples)
Browse files Browse the repository at this point in the history
  • Loading branch information
marinkaz committed Mar 17, 2015
1 parent 1afe274 commit 91fb41c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/code/usage.py
Expand Up @@ -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())
Expand Down
4 changes: 3 additions & 1 deletion nimfa/examples/medulloblastoma.py
Expand Up @@ -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.
Expand All @@ -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


Expand Down

0 comments on commit 91fb41c

Please sign in to comment.