renozao / NMF

NMF: A Flexible R package for Nonnegative Matrix Factorization
139 stars 41 forks source link

Poor Approximation by SNMF/R #185

Open jacobdornEcon opened 4 months ago

jacobdornEcon commented 4 months ago

Apologies for three issues, but I figured I should post minimum reproducible examples for three issues I've run into.

Suppose I want to do sparse non-negative matrix factorization on the matrix $(1, 2) \ (2, 4)$. I run: fitted(nmf(matrix(c(1, 2, 2, 4), nrow = 2), 1, 'snmf/r')) I would like to get the perfect rank-1 approximation $(1 \ 2) * (1, 2) = (1, 2) \ (2, 4)$. However, SNMF returns $(0.92, 1.84) \ (1.84, 3.68)$.

I assume there is something about the SNMF $L_1$ penalty that pulls the predictions towards zero. Is it clear what argument to change, and how, to get better fit under SNMF?