Eigenvectors & Eigenvalues for Machine Learning
A matrix is a transformation — it takes vectors and moves, rotates, stretches, or squishes them. For almost every vector, a matrix changes its direction. But a special few vectors keep their direction and only get stretched or shrunk. Those special vectors are eigenvectors, and the amount each is stretched is its eigenvalue.
Eigenvectors reveal the "natural axes" of a transformation — the hidden structure inside a matrix. This is exactly what many ML algorithms exploit: PCA finds the directions of maximum variance, spectral clustering finds community structure, and PageRank finds the "importance" vector of a web graph.

Part I — The Idea
1. Prerequisite: A Matrix is a Transformation
Before eigenvectors make sense, recall what multiplying a vector by a matrix does. A square matrix
Take the matrix
Notice something:
- The vector
changed direction (it now tilts more toward the -axis). - The vector
kept its direction and only got twice as long. - The vector
kept its direction and its length unchanged.
Those last two vectors — the ones that don't rotate — are the eigenvectors of
2. What Are Eigenvectors and Eigenvalues?
- Eigenvectors are nonzero vector that are associated with a matrix such that when the matrix multiplies the eigenvector, the resulting vector is a scalar multiple of the same eigenvector.
To say that
- Eigenvectors are the directions that remain unchanged during a transformation, even if they get longer or shorter.
- Eigenvalues are the numbers that indicate how much the eigenvector stretches or shrinks during that transformation.
- Eigenvectors are also called characteristic vectors and can only be found for square matrices (
).
— a square matrix (the transformation) — the eigenvector (a non-zero vector whose direction is preserved) (lambda) — the eigenvalue (the scalar stretch/shrink factor)
In words: "Transforming
"Eigen" is German for "own" or "characteristic." An eigenvector is a vector that a matrix treats as its "own" special direction — it belongs to the transformation.
2.1 Reading the Eigenvalue
The eigenvalue
| Eigenvalue |
Effect on the eigenvector |
|---|---|
| Stretched — same direction, longer | |
| Shrunk — same direction, shorter | |
| Unchanged — the vector is completely fixed | |
| Collapsed to zero — the direction is in the matrix's null space | |
| Flipped — reversed direction, then scaled by |
3. Geometric Intuition
Imagine placing a rubber sheet with an arrow grid on it and then stretching the sheet with your hands (the "stretch" is the matrix
- Most arrows get twisted to point in a new direction.
- A few special arrows still point the exact same way as before — they only got longer or shorter. Those are the eigenvectors.
- How much longer/shorter each of those special arrows became is its eigenvalue.
Spin a globe. Every city on the surface moves — except the two points on the axis of rotation (the North and South Poles). The axis of rotation is the eigenvector: the one direction that doesn't move under the "rotation transformation." For a pure rotation the eigenvalue along that axis is
Press a ball of dough flat between two boards. It spreads wide (a big stretch, large
Part II — Computing Them
4. The Characteristic Equation
We want non-zero eigenvectors
Rearranging:
Here
It has a non-zero solution
This is the characteristic equation. Solving it gives the eigenvalues
If
The Recipe (3 Steps)
- Eigenvalues: Solve
for . - Eigenvectors: For each
, solve for . - (Optional) Normalize: Scale each eigenvector to length 1 (common in ML).
5. Worked Example — 2×2 Matrix (Step by Step)
Let's find the eigenvalues and eigenvectors of:
Step 1 — Form
Step 2 — Set the determinant to zero (characteristic equation)
For a
Expand:
Step 3 — Solve for the eigenvalues
Factor the quadratic:
Step 4 — Find the eigenvector for
Substitute
Both rows give the same equation:
Step 5 — Find the eigenvector for
Substitute
This gives
Step 6 — Verify
Both check out. The matrix
6. Handy Shortcuts & Properties
For an
| Property | Rule | Check on the example ( |
|---|---|---|
| Sum of eigenvalues | ||
| Product of eigenvalues |
Other useful facts:
- Eigenvectors are not unique — any non-zero scalar multiple of an eigenvector is also an eigenvector (same direction). This is why we often normalize to length 1.
- Symmetric matrices (
) always have real eigenvalues and orthogonal (perpendicular) eigenvectors. Covariance matrices are symmetric — which is what makes PCA work so cleanly. - If any eigenvalue is
, the matrix is singular (non-invertible).
Part III — Eigendecomposition
7. Breaking a Matrix into Its Eigen-Parts
If an
Where:
— a matrix whose columns are the eigenvectors of . — a diagonal matrix with the eigenvalues on the diagonal. — the inverse of .
Intuition: this splits the transformation into three simple stages — rotate into the eigenvector coordinate system (
From the worked example in §5, we found:
Step 1 — Build
Step 2 — Build
Step 3 — Compute
For a
Step 4 — Verify
Bonus — Computing
No repeated matrix multiplication needed — just raise each eigenvalue to the power.
Once
Eigendecomposition only works for square matrices. SVD generalizes the idea to any
Part IV — Applications in Machine Learning
Eigenvectors and eigenvalues are not an abstract curiosity — they power some of the most-used algorithms in ML. The recurring theme: find the directions that matter most.
8. Principal Component Analysis (PCA) — The Flagship Use
This is the single most important application. PCA reduces the number of features while keeping as much information (variance) as possible.
The connection:
- Compute the covariance matrix of the data — a symmetric matrix describing how features vary together.
- Find its eigenvectors and eigenvalues.
- The eigenvectors are the principal components — the directions of maximum variance in the data.
- The eigenvalue of each eigenvector = the amount of variance captured along that direction.
- Keep the eigenvectors with the largest eigenvalues (most information) and drop the rest → dimensionality reduction.
Picture a stretched, cigar-shaped cloud of 2-D data points. The long axis of the cloud is the eigenvector with the largest eigenvalue — the direction where the data varies most. Projecting every point onto just that one axis keeps most of the information while collapsing 2-D down to 1-D. That is PCA in a nutshell.
The eigenvalues also tell you how much you can safely discard: the explained variance ratio of a component is its eigenvalue divided by the sum of all eigenvalues.
See the full step-by-step eigen-decomposition worked example in the PCA note.
9. Other Key Applications
| Application | Role of Eigenvectors / Eigenvalues |
|---|---|
| Covariance & correlation analysis | Eigenvectors of the covariance matrix expose the axes of greatest spread; eigenvalues quantify the spread — the foundation of PCA and whitening. |
| Spectral Clustering | Build a graph of the data, form its Laplacian matrix, and use its smallest eigenvectors to embed points so clusters become linearly separable — great for non-spherical clusters that k-means fails on. |
| PageRank (Google) | The ranking of web pages is the dominant eigenvector of the web's link matrix (eigenvalue |
| Recommender Systems | Matrix factorization (via SVD) uncovers latent factors — the eigen-directions of the user–item matrix — to predict missing ratings. |
| Image Compression | Keeping only the top eigenvectors (largest eigenvalues) of an image reconstructs it with far less data (e.g., "eigenfaces" for face recognition). |
| Deep Learning stability | Eigenvalues of the Hessian describe the curvature of the loss surface (conditioning, saddle points); eigenvalues of weight matrices relate to exploding/vanishing gradients. |
| Dynamical systems / RNNs | The largest-magnitude eigenvalue of a transition/weight matrix governs whether repeated application makes signals grow, shrink, or stay stable. |
10. Quick ML Example — Which Direction Carries the Signal?
Suppose after standardizing a small 2-feature dataset (e.g., height and weight) we compute the covariance matrix:
Its eigenvalues are
Interpretation:
11. Summary
| Concept | Meaning | Formula |
|---|---|---|
| Matrix as transformation | A square matrix moves/stretches vectors | |
| Eigenvector |
Direction unchanged by the transformation | |
| Eigenvalue |
How much the eigenvector is stretched/shrunk | |
| Characteristic equation | How we solve for eigenvalues | |
| Trace check | Sum of eigenvalues = diagonal sum | |
| Determinant check | Product of eigenvalues | |
| Eigendecomposition | Factoring a matrix into eigen-parts | |
| PCA link | Eigenvectors of covariance = principal components |
The Big Picture
- A matrix transforms vectors — usually changing their direction.
- Eigenvectors are the special directions that don't rotate; eigenvalues say how much they stretch.
- We find them by solving
, then back-substituting. - Eigendecomposition (
) reveals the simple stretches hiding inside any diagonalizable matrix. - In ML they find the directions that matter — maximum-variance axes in PCA, community structure in spectral clustering, and importance in PageRank.
The core takeaway: Eigenvectors are the natural axes of a transformation, and eigenvalues measure their importance. Whenever an ML method needs to find "the directions that matter most," eigenvectors and eigenvalues are doing the work.
12. Questions and Answers
-
What does the equation
mean in plain words?
Transforming the vector with the matrix produces the same result as simply scaling by the number — i.e., 's direction is unchanged and it is only stretched/shrunk by . -
Can a non-square matrix have eigenvectors?
No. Eigenvectors/eigenvalues are defined only for square ( ) matrices. For rectangular matrices we use the closely related SVD (singular values) instead. -
Why do symmetric matrices (like covariance matrices) matter so much in ML?
Symmetric matrices are guaranteed to have real eigenvalues and orthogonal (perpendicular) eigenvectors. Because a covariance matrix is symmetric, its eigenvectors form a clean set of perpendicular axes — exactly what PCA needs to define uncorrelated principal components. -
In PCA, what do a large vs. small eigenvalue tell you?
A large eigenvalue means its eigenvector (principal component) captures a lot of the data's variance — keep it. A small eigenvalue means that direction carries little information — it can be dropped to reduce dimensionality with minimal loss. -
A
matrix has and . What are its eigenvalues?
The eigenvalues satisfy and , giving and .
See Also
- PCA — dimensionality reduction built directly on the eigenvectors/eigenvalues of the covariance matrix.