Home / Maths for AI / Symbols / Vectors and matrices

Eigenvalue and eigenvector

Say it: "A v equals lambda v"

What it means

An eigenvector v\mathbf{v} is a direction that AA only stretches, by the factor λ\lambda (the eigenvalue), without turning.

Example

(2005)(01)=5(01)\begin{pmatrix} 2 & 0 \\ 0 & 5 \end{pmatrix}\begin{pmatrix} 0 \\ 1 \end{pmatrix} = 5 \begin{pmatrix} 0 \\ 1 \end{pmatrix}

The y-axis is stretched by 5.

In code

import numpy as np
vals, vecs = np.linalg.eigh([[2.0, 0], [0, 5.0]])
print(vals)
print(vecs)

Output

[2. 5.]
[[1. 0.]
 [0. 1.]]

Where it appears in machine learning

PCA keeps the eigenvectors of the covariance matrix with the largest eigenvalues.

Related symbols

Learn it properly in the free lesson Eigenvectors, Covariance & SVD, with practice questions that check your answers.