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

Unhelpful Failure Messages for Zero Columns Under Some Methods #184

Open
jacobdornEcon opened this issue Jul 18, 2024 · 0 comments
Open

Comments

@jacobdornEcon
Copy link

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?

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