You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose I want to get a rank-1 approximation to a matrix that happens to be $(1, 2, 0 \ 3, 6, 0)$. There is a unique (up to scaling) perfect factorization $(1 \ 3) * (1, 2, 0)$.
I try the following code: fitted(nmf(matrix(c(1, 2, 3, 6, 0, 0), nrow = 2), 1, 'lee'))
which returns $(1, 3, 0.002) \ (2, 6, 0.003)$. There's a bit of weird rounding in the third column, but otherwise it works!
Next, I try the brunet algorithm: fitted(nmf(matrix(c(1, 2, 3, 6, 0, 0), nrow = 2), 1, 'brunet'))
Which throws an error: non-conformable arrays
Finally, I try the snmf/r algorithm fitted(nmf(matrix(c(1, 2, 2, 4), nrow = 2), 1, 'snmf/r'))
which throws an error: 'a' is 0-diml
The second and third errors are uninformative as a user. Is it possible to generate a more informative error for this case, whatever the problematic case is?
The text was updated successfully, but these errors were encountered:
Suppose I want to get a rank-1 approximation to a matrix that happens to be$(1, 2, 0 \ 3, 6, 0)$ . There is a unique (up to scaling) perfect factorization $(1 \ 3) * (1, 2, 0)$ .
I try the following code:
$(1, 3, 0.002) \ (2, 6, 0.003)$ . There's a bit of weird rounding in the third column, but otherwise it works!
fitted(nmf(matrix(c(1, 2, 3, 6, 0, 0), nrow = 2), 1, 'lee'))
which returns
Next, I try the brunet algorithm:
fitted(nmf(matrix(c(1, 2, 3, 6, 0, 0), nrow = 2), 1, 'brunet'))
Which throws an error:
non-conformable arrays
Finally, I try the snmf/r algorithm
fitted(nmf(matrix(c(1, 2, 2, 4), nrow = 2), 1, 'snmf/r'))
which throws an error:
'a' is 0-diml
The second and third errors are uninformative as a user. Is it possible to generate a more informative error for this case, whatever the problematic case is?
The text was updated successfully, but these errors were encountered: