0% found this document useful (0 votes)
9 views3 pages

ML 5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

ML 5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

50

CYCLE-5
Aim: Singular Value Decomposition (SVD)
Solution:
Singular Value Decomposition (SVD) is a powerful technique widely used in solving
dimensionality reduction problems. This algorithm works with a data matrix of the
form, m x n, i.e., a rectangular matrix.

The idea behind the SVD is that a rectangular matrix can be broken down into a
product of three other matrices that are easy to work with. This decomposition is of
the form as the one shown in the formula below:

A=UΣVT

Where:

• A is our m x n data matrix we are interested in decomposing.


• U is an m x m orthogonal matrix whose bases are orthonormal.
• Σ is an m x n diagonal matrix.
• VT is the transpose of an orthogonal matrix.

Source Code:
51

Output:

The reason for decomposing a matrix is to represent it computationally efficiently so


that the original matrix recovered quickly from these singular matrices with the least
information loss.

Let us try this out and see if we obtain the same matrix upon multiplying the three
matrices of the SVD together.

Before we do this, it is essential to note that the S vector does not fit the rule of matrix
multiplication. Thus we first convert it into a diagonal matrix as follows.

Code:

Output:

We reconstruct our matrix A from its SVD. The code below will carry out this
operation.
52

Code: Output:

• We recovered our original matrix from its SVD.


• In the real world, the application of the SVD is not always to only retrieve the
entire matrixfrom the SVD.
• Instead, we truncate the SVD such that only the features with the most
information in the original matrix are recovered. By so doing, we reduce both
the needed computational powerand processing time.

You might also like