In this chapter, we start by implementing eigendecomposition by employing the eig() function from NumPy. We then show how to implement principal component analysis (PCA) via the eigendecomposition of the covariance matrix, and singular value decomposition (SVD) via its own factorisation of the data matrix. Further, we demonstrate the relationship between PCA and SVD. We also present how to use the PCA class from scikit-learn to perform PCA, and how to apply the svd() function from NumPy’s linalg submodule to carry out a singular value decomposition. Finally, we present an image compression application using SVD.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Matrix Decomposition

  • Yi Sun,
  • Rod Adams

摘要

In this chapter, we start by implementing eigendecomposition by employing the eig() function from NumPy. We then show how to implement principal component analysis (PCA) via the eigendecomposition of the covariance matrix, and singular value decomposition (SVD) via its own factorisation of the data matrix. Further, we demonstrate the relationship between PCA and SVD. We also present how to use the PCA class from scikit-learn to perform PCA, and how to apply the svd() function from NumPy’s linalg submodule to carry out a singular value decomposition. Finally, we present an image compression application using SVD.