# Non-negative matrix factorization

Non-negative matrix factorization (NMF) is a group of algorithms in multivariate analysis and linear algebra that factorizes a matrix into two lower-dimensional matrices with no negative elements, enabling parts-based, interpretable representations. It is widely used in fields such as audio processing, document clustering, and bioinformatics.

Non-negative matrix factorization (NMF or NNMF), also called non-negative matrix approximation, is a group of algorithms in multivariate analysis and linear algebra. The goal is to factorize a given matrix V into two matrices, typically denoted W and H, such that all three matrices contain only non-negative elements. This constraint makes the resulting factors easier to inspect and interpret, and it aligns with applications where the data itself is inherently non-negative, such as audio spectrograms or muscular activity measurements. Because an exact factorization is generally not possible, NMF methods compute an approximate solution numerically.

NMF has found applications across diverse fields, including astronomy, computer vision, document clustering, missing data imputation, chemometrics, audio signal processing, recommender systems, and bioinformatics. Its appeal lies in its ability to produce parts-based representations, where the original data is expressed as additive combinations of a small set of learned components.

## History

The concept of non-negative factorization has roots in chemometrics, where it was long known as "self modeling curve resolution." In that framework, the vectors in the right factor matrix are treated as continuous curves rather than discrete vectors. In the 1990s, a Finnish research group developed related methods under the name "positive matrix factorization." The approach gained broader recognition as non-negative matrix factorization after Daniel D. Lee and H. Sebastian Seung investigated its properties and published simple and effective algorithms for two types of factorization in 1999 and 2001. Their work highlighted the interpretability of the resulting factors and sparked widespread interest in the method.

## Background

Given a matrix V of size m × n, NMF seeks to approximate it as the product of two matrices: V ≈ W H, where W is m × p and H is p × n. The rank p is typically chosen to be much smaller than both m and n, so the factorization compresses the original data into a lower-dimensional representation. Matrix multiplication can be understood column-wise: each column vector of V is a linear combination of the column vectors of W, with coefficients given by the corresponding column of H.

For example, in a text-mining application, V might have 10,000 rows representing words and 500 columns representing documents. If the algorithm is asked to find 10 features, W will be 10,000 × 10 and H will be 10 × 500. Each column of the product W H is then a linear combination of the 10 feature vectors in W, weighted by the entries in the corresponding column of H. Each feature vector in W can be interpreted as a document archetype, where the cell values indicate the importance of each word in that feature. Similarly, each column of H gives the weights of these features for a specific document, allowing reconstruction of the original document as a weighted sum of the archetypes.

## Clustering Property

NMF possesses an inherent clustering property. When approximating V by W H, the algorithm automatically clusters the columns of the input data. The approximation is achieved by minimizing an error function, often the Frobenius norm of the difference between V and W H, subject to the non-negativity constraints on W and H. If an additional orthogonality constraint is imposed on H (i.e., H Hᵀ = I), the minimization becomes mathematically equivalent to K-means clustering. In this case, the entries of H directly indicate cluster membership: for a given column j, the largest entry H_kj identifies the cluster to which the data point v_j belongs. This property makes NMF a useful tool for unsupervised learning and exploratory data analysis.

## Algorithms and Computation

Several algorithms have been developed to compute NMF. The most widely used is the multiplicative update rule introduced by Lee and Seung, which iteratively updates W and H while preserving non-negativity. Other approaches include alternating least squares, projected gradient methods, and variants that incorporate sparsity or smoothness constraints. The choice of algorithm often depends on the size of the data, the desired accuracy, and the specific application. Because the problem is non-convex, solutions may depend on initialization, and multiple runs with different starting points are sometimes used to obtain a stable result.

## Applications

NMF is applied in a wide range of domains. In audio signal processing, it is used to decompose spectrograms into spectral components, enabling source separation or music transcription. In document clustering and topic modeling, NMF identifies latent topics as sets of words, with each document represented as a mixture of topics. In bioinformatics, it helps analyze gene expression data by identifying patterns of co-expressed genes. In recommender systems, NMF can factorize user-item rating matrices to uncover latent factors that predict user preferences. Additionally, NMF has been used in computer vision for facial feature extraction and in chemometrics for resolving overlapping spectral signals.

## See Also

- [machine-learning](https://www.wikiprompt.org/wiki/machine-learning)
- [artificial-intelligence](https://www.wikiprompt.org/wiki/artificial-intelligence)
- [deep-learning](https://www.wikiprompt.org/wiki/deep-learning)
- [neural-network](https://www.wikiprompt.org/wiki/neural-network)
- [generative-ai](https://www.wikiprompt.org/wiki/generative-ai)

---
Source: https://www.wikiprompt.org/wiki/non-negative-matrix-factorization
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-09-07T21:30:40.739776+00:00
