gdkrmr / dimRed

A Framework for Dimensionality Reduction in R
https://www.guido-kraemer.com/software/dimred/
GNU General Public License v3.0
73 stars 15 forks source link

Nonnegative Matrix Factorization #16

Closed topepo closed 6 years ago

topepo commented 6 years ago

Any plans on including this? I might get motivated enough to submit a PR. If so, you you prefer any particular package (NMF or NNLM)?

gdkrmr commented 6 years ago

actually this was completely off my radar and I have no overview of already implemented functions in R, do you have any opinions about these two packages?

PR would be welcome, I am not sure if I will find the time to dig into the different methods implemented in R any time soon. If you need help with implementation details, don't hesitate to ask.

topepo commented 6 years ago

I was looking today and I like NNLM since it has a predict method. I'll try putting a PR together and model is after the PCA code.

gdkrmr commented 6 years ago

ok, great! I made a change to the develop branch some days ago, so that other kinds of results can be returned in the @other.data slot, it is meant to hold eigenvalues, rotation matrices, etc., see https://github.com/gdkrmr/dimRed/blob/develop/R/isomap.R#L137 for an example.

topepo commented 6 years ago

Please give that a look. It is incomplete but I didn't want to go down the wrong path.

ok, great! I made a change to the develop branch some days ago, so that other kinds of results can be returned in the @other.data slot, it is meant to hold eigenvalues, rotation matrices, etc., see

Should I just put the NNLM::nnmf object there?

gdkrmr commented 6 years ago

Please give that a look. It is incomplete but I didn't want to go down the wrong path.

Haven't tried it out, but it looks good to me.

Should I just put the NNLM::nnmf object there?

With Isomap I built in a switch if the geodesic distance matrix should be included, because the matrix may be quite large and is only really needed for specialized applications. if the object usually stays small, like the eigenvalues or a rotation matrix in PCA I'd just put it there.

If I understand it right, NNMF decomposes an n x m matrix into one n x r and one r x m which should generally be fine. Just do it, if anyone should ever get memory/storage issues, we can still make it optional.

The @other.data slot currently only exists on the develop branch.

gdkrmr commented 6 years ago

I had a look on the NNLM package and it looks pretty cool!

gdkrmr commented 6 years ago

done