Free preview
59 lessons
Essential Linear Algebra for ML
Free preview
Essential Linear Algebra for ML · 59 lessons
No surprise gaps
Actually remember it
Skip what you know
One subscription. All learning paths included.
Our content is best on a larger screen
From the unit circle to the ellipse
To see the geometry of the singular value decomposition, we start with the unit circle in : the set of all vectors of length one. The reason for focusing on the unit circle is simple. If we want to understand how a matrix acts on all directions at once, we can apply it to every point on the circle. The resulting shape captures the global effect of the transformation.
When we apply a matrix to the unit circle, the resulting set of points is always an ellipse (or a degenerate ellipse if the matrix has rank one or zero). This ellipse is the geometric fingerprint of the matrix: it shows exactly how the transformation stretches and rotates space.
Details
This circle‑to‑ellipse picture is the stage on which the SVD plays out. The singular values will turn out to be the lengths of the ellipse’s axes, and the singular vectors will be the directions of those axes.
Visualisation
Have a play with the interactive visualisation below to get a feel for how turns a circle into an ellipse. The visualisation shows the unit circle and the result of for all vectors that lie on the unit circle for any matrix .
Adjust the entries of the matrix
Details
Geometry of the SVD
The singular value decomposition tells us that any matrix can be written as
where and are orthogonal matrices and is diagonal with non‑negative entries.
Geometrically, this means that applying to the unit circle always happens in three clean steps.
So the unit circle always becomes an ellipse, and the SVD gives the universal recipe: rotate → stretch → rotate.
This geometric view explains why the SVD is so powerful. The singular values are the lengths of the ellipse’s axes. The right singular vectors (the columns of ) are the input directions that get stretched. The left singular vectors (the columns of ) are the output directions of the ellipse’s axes.
Unlike eigendecomposition, which only works in special cases, the SVD always produces this clean orthogonal picture.
Details
Visualisation
With an animation, we can make this process vivid and interactive: it allows us to modify , and (which compose ) and see the impact of the linear transformation for all vectors which lie on the unit circle. At each stage, the geometry is simple and transparent.
We begin with the unit circle (red) and the standard basis vectors,
Details
Practice questions
4 questions
Suppose is a unit vector on the unit circle in . What happens when we apply to in the SVD ?
Select the correct answer:
+ 3 more questions
Zero singular values
So far we have seen the geometry of the SVD when both singular values are positive: the unit circle becomes a full ellipse. But what if one of the singular values is zero, or if the matrix is rectangular? In those cases, the ellipse collapses in one or more directions. This is exactly what zero singular values record, and it is the next piece of the story.
Rank deficiency (true zero singular values)
Even within the singular values on 's main diagonal, some may be zero if the matrix is not full rank. This means that the transformation actively collapses certain directions completely.
For example, a matrix of rank has only one linearly independent column. This means the second column is a multiple of the first, so the matrix cannot span two independent directions. In the SVD, this shows up as one positive singular value and one zero singular value . On top of that, there is the extra zero row in to make it .
So the single non‑zero singular value reflects the one independent direction in the columns of , while the zero singular value reflects the redundancy.
Geometrically, the ellipse collapses into a line segment: only one axis survives, the other is squashed flat.
Tip
The number of non‑zero singular values of a matrix is equal to its rank.
So if a matrix has rank , then it has exactly positive singular values, and the remaining singular values are zero.
Visualisation
Have a play with the interactive visualisation below. Note that here we’ve fixed , so . That means when a singular value is zero, we see a whole row or column of zeros in .
In a typical matrix , rank deficiency doesn’t usually appear as literal zeros - instead, one row (or one column) is a linear combination of the others. The SVD makes this structure explicit by rotating into a basis where the dependency shows up as a zero in . Either way, the geometry is the same: a zero singular value means one direction is completely collapsed.
Aside: rectangular matrices
Even when a matrix is full rank, if it is rectangular then must be padded with zeros. This is not just padding for shape - it reflects a real limitation: a matrix can only stretch space in at most independent directions.
That is why, when we computed the SVD of a rectangular matrix , we had to add extra orthonormal vectors to complete and , and pad with zeros.
The extra vectors in or point in directions where the transformation does nothing, and the matching zeros in record this fact.
Details
Key Point
The SVD always maps the unit circle (or hypersphere) to an ellipse (or ellipsoid).
This is why the SVD is universal: it makes both the stretching and the limitations of any matrix completely explicit.
Practice questions
5 questions
Consider the matrix
From the SVD we find that
Now take an arbitrary input vector
When we compute , the coordinates and represent how much of lies along the right singular vectors and . Multiplying by gives
Notice that the second entry of is always zero, regardless of the input vector .
What is the correct interpretation of this fact?
Select the correct answer:
+ 4 more questions