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

Snmf factorization method does not maintain consistency of sparseness across runs if version='l' #35

Closed
haesemeyer opened this issue Oct 3, 2016 · 0 comments
Assignees

Comments

@haesemeyer
Copy link
Contributor

haesemeyer commented Oct 3, 2016

The Snmf factorization method Snmf.factorize() does not handle transposes correctly across multiple runs.
In order to enforce sparseness on the left factor the method transposes self.V (lines 175-176) , fits the model and then back-transposes V and swaps W and H (lines 224-226). However, the initial transpose is done outside run loop which starts in line 178. Therefore, sparseness is not enforced on the same factor across runs, with odd runs being correct and even runs operating on the orignal self.V (self.V.T.T). Symptomatic for this, if nruns is even, W and H will be returned with the wrong dimensionality (i.e. swapped and transposed).
This should be easily fixable by moving lines 175-176 of snmf.py below line 178 to ensure a re-transpose of self.V before each new fit.
#36

@marinkaz marinkaz self-assigned this Oct 3, 2016
marinkaz added a commit that referenced this issue Oct 3, 2016
@marinkaz marinkaz closed this as completed Oct 3, 2016
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

2 participants