GithubHelp home page GithubHelp logo

thenmf / bignmf Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 1.0 442 KB

A python package for performing single NMF and joint NMF algorithms

License: MIT License

Python 100.00%
python nmf machine-learning factorization python-package

bignmf's People

Contributors

dependabot[bot] avatar haranrk avatar vaibhav-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hank9cao

bignmf's Issues

ValueError during run

When I run the code:

nmf_cm = StandardNmf(pd.DataFrame(data_tfidf), k = 20)
nmf_cm.run(iterations = 1000, trials = 20)

I get the following error:

ValueError
30 nmf_cm = StandardNmf(pd.DataFrame(data_tfidf), k = k)
---> 31 nmf_cm.run(iterations = 100, trials = 20, verbose = 0)
32 nmf_cm.calc_consensus_matrices()
33 nmf_cm.calc_cophenetic_correlation()

File ...\bignmf\models\snmf\snmf_base.py:52, in SnmfBase.run(self, trials, iterations, verbose)
50 print("\tTrial: %i completed with Error: %f " % (i, self.error))
51 # Normalization
---> 52 self.consensus_matrix_w = self.reorder_consensus_matrix(self.consensus_matrix_w / trials)
53 self.consensus_matrix_h = self.reorder_consensus_matrix(self.consensus_matrix_h / trials)
54 # Converting values to DataFrames

File ...\bignmf\models\nmf.py:69, in NmfBase.reorder_consensus_matrix(M)
67 M = pd.DataFrame(M)
68 Y = 1 - M
---> 69 Z = linkage(squareform(Y), method='average')
70 ivl = leaves_list(Z)
71 ivl = ivl[::-1]

File ...\scipy\spatial\distance.py:2354, in squareform(X, force, checks)
2352 raise ValueError('The matrix argument must be square.')
...
2436 'be zero.') % name)
2437 else:
2438 raise ValueError('Distance matrix diagonal must be zero.')

ValueError: Distance matrix 'X' diagonal must be zero.

My input is TFIDF data and there are no negative elements in it. Is there something wrong in the implementation of the function or am I making a mistake?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.