An R implementation of classical non-negative matrix factorization (NMF).
Arguments
- X
A non-negative numeric matrix (features x samples) to be factorized. All elements must be non-negative.
- K
The rank of factorization, i.e., the number of components/latent features to extract. Must be a positive integer smaller than both dimensions of X.
- maxiter
The maximum number of iterations for the optimization algorithm. Defaults to 2000.
- tol
The convergence tolerance for the loss function. The algorithm stops when the absolute change in Euclidean distance between consecutive iterations is less than this value. Defaults to 1e-5.
Value
A list containing the factorization results:
W- The basis matrix (features x K), representing the learned features or componentsH- The coefficient matrix (K x samples), representing the weights or activations of components for each sampleiter- The number of iterations actually performedloss- The final value of the objective function (squared Euclidean distance)
See also
This function is from scAB package, and it is not recommended to use it because the computational efficiency of the R language is not very high.
For more advanced NMF implementations, see:
nmf from the NMF package, which is written in C++ and is much faster than this function.
Other scAB:
DoscAB(),
create_scAB.v5(),
findSubset.optimized(),
scAB.optimized(),
select_K.optimized()