Singular Value Decomposition (SVD) is a type of matrix factorization (decomposition), which can factorize matrices into two orthogonal matrices and diagonal matrices. You can multiply the original matrix back using these three matrices. SVD can reduce redundant data that is linear dependent from the perspective of linear algebra. Therefore, it can be applied to feature selection, image processing, clustering, and many other fields. In this recipe, we will illustrate how to perform dimension reduction with SVD.
Perform the following steps to perform dimension reduction using SVD:
- First, you can perform
svd
on theswiss
dataset:
> swiss.svd = svd(swiss)
- You can then plot the percentage of variance explained and the cumulative variance explained in accordance with the SVD column:
> plot(swiss.svd$d^2/sum(swiss.svd$d^2), type="l", xlab...