Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the bmf function to obtain a binary matrix? #63

Open
wellfrogliu opened this issue May 31, 2022 · 0 comments
Open

How to use the bmf function to obtain a binary matrix? #63

wellfrogliu opened this issue May 31, 2022 · 0 comments

Comments

@wellfrogliu
Copy link

I read the introdcution for the bmf function in nimfad and it's great! But when i used bmf function, i could not get binary matrix w. My code is :
`import numpy as np
import nimfa

V = np.random.rand(23, 200)

bmf = nimfa.Bmf(V, max_iter=10, rank=30, n_run=3, track_factor=True)
bmf_fit = bmf()

print('K-L divergence: %5.3f' % bmf_fit.distance(metric='kl'))

sm = bmf_fit.summary()
print('Rss: %5.3f' % sm['rss'])
print('Evar: %5.3f' % sm['evar'])
print('Iterations: %d' % sm['n_iter'])
print('Cophenetic correlation: %5.3f' % sm['cophenetic'])
W = bmf_fit.basis()
print('Basis matrix:\n%s' % W)`

The W matrix was not binary . When i changed V matrix into binary matrix, the w matrix is still not binary matrix.
Can someone help me how can get binary matrix.? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant