A singular vector is an eigenvector of either A Aᵀ or AᵀA. These vectors form the orthonormal factors used to decompose an m × n matrix with singular value decomposition (SVD), which works for rectangular matrices as well as square ones. section 3.6
Use singular vectors to:
- Represent the orthogonal matrices U and V in SVD; their corresponding singular values are the square roots of the eigenvalues. section 3.6
- Reduce dimensions by selecting leading singular vectors and examining the variance explained by each one. section 3.6.1
- Work with sparse datasets where SVD is presented as an alternative to PCA based on eigenvalue decomposition. section 3.6
Mushroom feature reduction
Encode categorical mushroom data, separate predictors from the class label, standardize the predictors, and run `u, s, v = np.linalg.svd(X_features, full_matrices=True)`. Compute `s**2 / sum(s**2)` to estimate variance explained, place the first two columns of `u` in a dataframe as SV1 and SV2, and plot them against edible or poisonous class labels. section 3.6.1
(3.3)
A = U * S * VT
The factorization A = U * S * Vᵀ shows where singular vectors appear in the SVD representation. section 3.6
