nmf | R Documentation |
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
)
x |
Input matrix for factorization. Can be either dense or sparse. |
k |
Integer. Factor matrix rank. |
niter |
Integer. Maximum number of NMF interations. |
algo |
Algorithm to perform the factorization, choose from "anlsbpp", "admm", "hals" or "mu". See detailed sections. |
nCores |
The number of parallel tasks that will be spawned. Only applies to anlsbpp.
Default |
Winit |
Initial left-hand factor matrix, must be of size m x k. |
Hinit |
Initial right-hand factor matrix, must be of size n x k. |
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.
Ramakrishnan Kannan and et al., A High-Performance Parallel Algorithm for Nonnegative Matrix Factorization, PPoPP '16, 2016, 10.1145/2851141.2851152
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.