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

error in rank comparison computations #90

Open
Frank73 opened this issue Jul 5, 2017 · 8 comments
Open

error in rank comparison computations #90

Frank73 opened this issue Jul 5, 2017 · 8 comments

Comments

@Frank73
Copy link

Frank73 commented Jul 5, 2017

nmf was called with the following arguments, where tdm is a term-document matrix with 3133 rows and 5837 columns:

nmf(tdm, rank=2:10, seed = "random", nrun = 100, .options = "v")

The output was as follows:

Compute NMF rank= 2 ... + measures ... OK
Compute NMF rank= 3 ... + measures ... OK
Compute NMF rank= 4 ... + measures ... OK
Compute NMF rank= 5 ... + measures ... OK
Compute NMF rank= 6 ... + measures ... OK
Compute NMF rank= 7 ... + measures ... OK
Compute NMF rank= 8 ... + measures ... OK
Compute NMF rank= 9 ... ERROR
Timing stopped at: 3442 134.6 1907
ERROR
Compute NMF rank= 10 ... + measures ... OK
nmfPlotQuality: nmf from tdm: 27360.324758
Warning messages:
1: In (function (...) :
NAs were produced due to errors in some of the runs:
-#8[r=9] -> NMF::nmf - Unexpected error: no partial result seem to have been saved.
2: Removed 10 rows containing missing values (geom_point).


And I did not get results for rank=9.

How can this be avoided?

@renozao
Copy link
Owner

renozao commented Jul 5, 2017

Can you please try reproducing the error using a fixed seed and just the rank=9 run, so that I can also debug it on my side?
You can either send me the data by email (if it is ok) or code to generate a toy data that produces the same error.
Thanks

@Frank73
Copy link
Author

Frank73 commented Jul 5, 2017

Hi Renozao,

While the above example is running with your requested changes, I played around to get an easier example and came up with this error:

> goodM
     [,1] [,2] [,3]
[1,]    1    1    1
[2,]    0    0    1
> badM
     [,1] [,2] [,3]
[1,]    1    1    0
[2,]    0    0    1
> r <- nmf(goodM, 2)                                                            
> fitted(r)                                                                     
             [,1]         [,2] [,3]
[1,] 1.000000e+00 1.000000e+00    1
[2,] 2.756248e-16 2.756248e-16    1
> r <- nmf(badM, 2)
Error in cons != .consold : non-conformable arrays
Timing stopped at: 0.012 0 0.012
>

Why isn't this working?

@renozao
Copy link
Owner

renozao commented Jul 6, 2017 via email

@Frank73
Copy link
Author

Frank73 commented Jul 6, 2017

OK, great.
The example at the beginning of this thread is impractical, since it is taking to much time to finish. I'll try to find a smaller example.

@renozao
Copy link
Owner

renozao commented Jul 6, 2017 via email

@pogacsa
Copy link

pogacsa commented Mar 2, 2018

Hi, I'm running into all sorts of errors described here and in issue #89. I installed the devel branch therefore, but the exact same errors occur with the same parameters. :( Sometimes it runs through with the same matrix, if the number of runs is only 1, but not, if higher.
"Error in cons != .consold : non-conformable arrays" is my latest error mit devel.
Sessioninfo says NMF_0.23.6, my R version is 3.4.1.
Any ideas?

@pogacsa
Copy link

pogacsa commented Mar 2, 2018

If I run it with a range of ranks, all produce an error:
Error in (function (...) : All the runs produced one of these two errors:
comparison of these types is not implemented [in call to '==']
non-conformable arrays [in call to '!=']

@KafeelBasha
Copy link

I am trying to work in NMF package in R for recommendations, so I am using 'lee' method in nmf().

Which minimizes squared error, ||V-WH||^2. With "model_nmf=nmf(as(rating,"matrix"),15,'lee')", getting error as "Error in cons != .consold : non-conformable arrays. Timing stopped at: 37.25 0.25 37.75"
The object "rating" has NAs, how can I resolve this error.

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

4 participants