The Non-Negative Matrix Factorization (NMF) is a decomposition of a matrix
into a product of two matrices
X = WH,
where all entries in W and H
are positive or zero. When the inner dimension of the product
(the number of columns of W) is less than the
rank of X, then the product is only an approximation,
and the factorization is sometimes referred to as the
Approximative Non-Negative Matrix Factorization.
In the Extreme Optimization Mathematics Library for .NET, the non-negative matrix factorization is implemented
by the NonNegativeMatrixFactorization
class.
The NonNegativeMatrixFactorization class
The NonNegativeMatrixFactorization
class represents the non-negative matrix factorization of a matrix. It has only one constructor which takes
two paramters. The first is a Matrix that represents
the matrix that is to be factored. The second parameter is an integer that specifies the inner dimension
of the matrix product. If this value is less than both the number of rows and columns of the original
matrix, then the factorization is approximate.
The Decompose()()()() method
performs the actual decomposition using an alternating least squares algorithm. For large matrices, this method may take a
long time to complete. This method is called by other methods as needed. You will rarely
need to call it explicitly.
After the decomposition is computed, the LeftFactor and
RightFactor
properties return DenseMatrix objects that
represent the non-negative factors.
Unlike other matrix decompositions, the non-negative matrix factorization
does not help with solving systems of equations or related operations. Although
methods like Solve()()()()
are defined, they simply delegate the work to the corresponding method on the
base matrix.