Regularly, Non-negative Matrix Factorization (NMF) is factorizes input matrix \(X\) into low rank matrices \(W\) and \(H\), so that \(X \approx WH\). The objective function can be stated as \(\arg\min_{W\ge0,H\ge0}||X-WH||_F^2\). In practice, \(X\) is usually regarded as a matrix of \(m\) features by \(n\) sample points. And the result matrix \(W\) should have the dimensionality of \(m \times k\) and H with \(n \times k\) (transposed). This function wraps the algorithms implemented in PLANC library to solve NMF problems. Algorithms includes Alternating Non-negative Least Squares with Block Principal Pivoting (ANLS-BPP), Alternating Direction Method of Multipliers (ADMM), Hierarchical Alternating Least Squares (HALS), and Multiplicative Update (MU).
nmf(
x,
k,
niter = 30L,
algo = "anlsbpp",
nCores = 2L,
Winit = NULL,
Hinit = NULL
)
A list with the following elements:
W
- the result left-hand factor matrix
H
- the result right hand matrix.
objErr
- the objective error of the factorization.
Input matrix for factorization. Can be either dense or sparse.
Integer. Factor matrix rank.
Integer. Maximum number of NMF interations.
Algorithm to perform the factorization, choose from "anlsbpp", "admm", "hals" or "mu". See detailed sections.
The number of parallel tasks that will be spawned. Only applies to anlsbpp.
Default 2
Initial left-hand factor matrix, must be of size m x k.
Initial right-hand factor matrix, must be of size n x k.
Ramakrishnan Kannan and et al., A High-Performance Parallel Algorithm for Nonnegative Matrix Factorization, PPoPP '16, 2016, 10.1145/2851141.2851152