# What is SVD and NMF? (Learning from Computational Linear Algebra course)

fastai
linear_algebra
Author

Kurian Benoy

Published

February 11, 2019

Singular-value decomposition (SVD)

Singular-value decomposition (SVD) is a factorization of a real or complex matrix. It is the generalization of the eigendecomposition of a positive semidefinite normal matrix (for example, a symmetric matrix with positive eigenvalues) to any m × n {mn} ￼ matrix via an extension of the polar decomposition. It has many useful applications in signal processing and statistics. Formally, the singular-value decomposition of an m × n real or complex matrix M ￼ is a factorization of the form U Σ V ∗ ￼, where U ￼ is an m × m ￼ real or complex unitary matrix, Σ ￼ is an m × n rectangular diagonal matrix with non-negative real numbers on the diagonal, and V ￼ is an n × n ￼ real or complex unitary matrix. The diagonal entries σ i ￼ of Σ ￼ are known as the singular values of M ￼. The columns of U ￼ and the columns of V ￼ are called the left-singular vectors and right-singular vectors of M ￼, respectively. The singular-value decomposition can be computed using the following observations: The left-singular vectors of M are a set of orthonormal eigenvectors of MM∗. The right-singular vectors of M are a set of orthonormal eigenvectors of M∗M. The non-zero singular values of M (found on the diagonal entries of Σ) are the square roots of the non-zero eigenvalues of both M∗M and MM∗.source.

You maybe bored with this wikipedia definition. Yet what if I say to you Singular value decomposition is one of the most popular algorithms which have influence our society and is used in many fields like medicines, data science , Spacial science and much more like famous algorithms like fast fourier integration, Monte Carlo Integration , quick sort and much more. But according to math_rachael, the algorithm has not yet recieved the attentinon it really deserves to get.

SVD is basically a small equation such that:

``A[data matrix] = U[left singular matrix] * epsilon(diagonal of singular values) * VT[right singular values)``

where: - A is an mn matrix - U is an mn orthogonal matrix - S is an nn diagonal matrix - V is an nn orthogonal matrix

To dive more into SVD check topic modelling from fast.ai Linear algebra class

Non-negative Matrix Factorization

Rather than constraining our factors to be orthogonal, another idea would to constrain them to be non-negative. NMF is a factorization of a non-negative data set V:

`V=WH`

into non-negative matrices W,H. Often positive factors will be more easily interpretable (and this is the reason behind NMF’s popularity).

NMF is a state of art feature detection algorithm. NMF is useful when there are many attributes and these attributes are weak predictabililty. By combining attributes, NMF can produce meaningful patterns, topics, or themes. NMF is often useful in text mining. In a text document, the same word can occur in different places with different meanings

NMF is commonly used in : - Topic Modelling - Face Decomposition - Audio source seperation - Chemistry - Bioinformation and much more

Let’s dive more into NMF with a face decomposition examples : link
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://kurianbenoy.com/posts/2019/2019-02-11-SVD_NMF.html", "fetch_time": 1719265843000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2024-26/segments/1718198865490.6/warc/CC-MAIN-20240624214047-20240625004047-00633.warc.gz", "warc_record_offset": 307906837, "warc_record_length": 8683, "token_count": 747, "char_count": 3210, "score": 3.671875, "int_score": 4, "crawl": "CC-MAIN-2024-26", "snapshot_type": "latest", "language": "en", "language_score": 0.8684923648834229, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00010-of-00064.parquet"}