/  Top Machine learning interview questions and answers   /  What do you mean by Singular Value Decomposition?

What do you mean by Singular Value Decomposition?

The Singular-Value Decomposition, or SVD for short, is a matrix decomposition method for reducing a matrix to its constituent parts in order to make certain subsequent matrix calculations simpler.

The example below defines a 3×2 matrix and calculates the Singular-value decomposition.

# Singular-value decomposition

from numpy import array

from scipy.linalg import svd

# define a matrix

A = array([[1, 2], [3, 4], [5, 6]])

print(A)

# SVD

U, s, VT = svd(A)

print(U)

print(s)

print(VT)

Leave a comment