[][src]Module smartcore::linalg::evd

The matrix is represented in terms of its eigenvalues and eigenvectors.

Eigen Decomposition

Eigendecomposition is one of the most useful matrix factorization methods in machine learning that decomposes a matrix into eigenvectors and eigenvalues. This decomposition plays an important role in the the Principal Component Analysis (PCA).

Eigendecomposition decomposes a square matrix into a set of eigenvectors and eigenvalues.

\[A = Q \Lambda Q^{-1}\]

where \(Q\) is a matrix comprised of the eigenvectors, \(\Lambda\) is a diagonal matrix comprised of the eigenvalues along the diagonal, and \(Q{-1}\) is the inverse of the matrix comprised of the eigenvectors.

Example:

use smartcore::linalg::naive::dense_matrix::*;
use smartcore::linalg::evd::*;

let A = DenseMatrix::from_2d_array(&[
                 &[0.9000, 0.4000, 0.7000],
                 &[0.4000, 0.5000, 0.3000],
                 &[0.7000, 0.3000, 0.8000],
        ]);

let evd = A.evd(true).unwrap();
let eigenvectors: DenseMatrix<f64> = evd.V;
let eigenvalues: Vec<f64> = evd.d;

References:

Structs

EVD

Results of eigen decomposition

Traits

EVDDecomposableMatrix

Trait that implements EVD decomposition routine for any matrix.