Non-negative matrix factorizations¶
A rank-k non-negative matrix factorization of an \(m \times n\) matrix \(A\) with all non-negative entries is a solution to the problem
\[\min_{X,Y} \| A - X Y \|_F, \text{ such that } X,Y \ge 0\]
where \(X\) is \(m \times k\) and \(Y\) is \(k \times n\).
The following routines employ alternating non-negative least squares algorithms.
Note
The following routines are still just prototypes and do not employ proper stopping criteria
Python API¶
-
NMF
(A[, ctrl=None])¶ - Parameters
A – dense, sequential or distributed matrix to approximate with NMF
ctrl – (optional)
NNLSCtrl_s
orNNLSCtrl_d
control structure, depending upon whether the data is single-precision or double-precision
- Return type
the two non-negative factors (which will have types compatible with that of
A
)
C++ API¶
-
void
NMF
(const Matrix<Real> &A, Matrix<Real> &X, Matrix<Real> &Y, const NNLSCtrl<Real> &ctrl = NNLSCtrl<Real>())¶
-
void
NMF
(const ElementalMatrix<Real> &A, ElementalMatrix<Real> &X, ElementalMatrix<Real> &Y, const NNLSCtrl<Real> &ctrl = NNLSCtrl<Real>())¶