JuliaStats / NMF.jl

A Julia package for non-negative matrix factorization
Other
91 stars 34 forks source link

Options for fixing `W` or `H` during `solve!` #44

Closed mileslucas closed 3 years ago

mileslucas commented 3 years ago

I have a use-case for NMF which fits the W1, H matrices using one dataset, then solves for W2 (using the same H) for a second dataset. The point is to use a reference data set to produce the "components" and then fit a target data set to those components.

In sklearn, this is achievable by calling fit on the reference data and then transform on the target data. This makes a lower-level call to non_negative_factorization which has an option update_H::Bool.

This seems like something that could be added as an option to the solve! function.

mileslucas commented 3 years ago

For reference: https://github.com/scikit-learn/scikit-learn/blob/0fb307bf39bbdacd6ed713c00724f8f871d60370/sklearn/decomposition/_nmf.py#L1317-L1341

ghost commented 3 years ago

I'll work on it and create a PR soon.