A Julia package for Non-negative Matrix Factorization based on the method introduced by Lee and Seung and compliant with the MLJ model interface.
To train an NMF model, first load MLJ and this package
using MLJ, MLJNonnegativeMatrixFactorization
The NMF can then be instantiated in the usual way for an unsupervised model:
nmf = NMF()
mach = machine(nmf, df)
fit!(mach)
Calling fitted_params
on the trained machine will return a tuple containing the factor matrix (a.k.a. endmembers) W
and the factor loading matrix (a.k.a. abundances) H
.
The NMF can be used for feature extraction via W
or for dimensionality reduction to the factor loadings via
Ĥ = MLJ.transform(mach, X)