Linear Algebra for Machine Learning
From a single point in space to the mathematics inside every modern model. Taught from first principles, on real data from the first minute.
- Every idea arrives with the problem that forced it into existence.
- Every symbol is earned before it is used.
- Every result is derived, then seen, then put to work on real data.
Lecture 2, 22:00, free
Vectors, Span & Basis
What lives exactly halfway between a photo of a dog and a photo of a beach?
Volume I
The arc
The whole subject. In the order it wants to be learned.
- 01 Open
Space, Distance & Similar Photos
Your phone has never met your friend. So how does it gather forty photos of her into one pile?
- Dimension
- A photo is a point
- Distance
- Learning as a walk
- Manifolds
Inside this lecture
How your phone gathers photos of the same face, and why the obvious guess is only half right. Zero, one, two, three dimensions, and far beyond. Span and basis, first glimpsed. Why we choose perpendicular rulers. A photo as one point in thirty-six million dimensions, and every possible photo already waiting in that space. Distance in any dimension: Pythagoras, and the taxicab. Learning as a point walking towards the truth. Manifolds, and the manifold hypothesis.
- 02 Open
Vectors, Span & Basis
What lives exactly halfway between a photo of a dog and a photo of a beach?
- Vectors
- Linear combinations
- Real analysis
- Span
- Basis
Inside this lecture
Points become arrows. Notation, from brackets to Dirac’s ket. Scaling, adding and subtracting: the parallelogram, element by element, and king − man + woman. Why vectors of different dimensions cannot be added. The rules underneath, from real analysis, and where floating point quietly breaks one. Linear combinations, the ghost between two photos, and faces that morph. Span, basis and dimension, and first sightings of linear independence and the vector space.
- 03 Coming soon
Matrices & Multiplication
Four measurements go in. One risk score comes out. What happened in between?
- The language of data
- A x, by columns
- Rows
- Identity & transpose
- Inside a neural layer
Inside this lecture
The language of data: samples, features, targets and predictions, and the notation papers assume you already know. The family of products. A x as a mix of the columns of A; a row vector times a matrix as a mix of its rows. Matrix times matrix, one column at a time. The identity, the transpose, and why the shapes must agree. Why vectors are columns. And the engine of every neural-network layer, worked by hand.
- 04a Coming soon
Linear Equations & the Two Pictures
We know the patients. We know the scores. What recipe sits in between?
- Why weights
- What linear means
- The row picture
- The column picture
- One, none, or infinitely many
Inside this lecture
Why plain adding fails: units, importance and direction. Two proofs: that a recipe works, and that nothing else does. Linear means a constant rate and no interaction, and why machine learning means linear in the weights. A x = b, and why x and b live in different spaces. The row picture: every recipe at once, ripples of predictions, measurements that tilt and scores that slide. Walking one patient’s line. Hyperplanes in any dimension, and the network that memorised random labels. The column picture: arrows walked tip to tail to reach b. Two spaces, one bridge. Collapsed arrows, scores lifted off the sheet, and why a linear system never has exactly two answers.
- 04b Coming soon
Gaussian Elimination
How does a computer solve A x = b, in a million dimensions?
- Three safe moves
- Pivots
- Elimination as matrices
- The determinant
- Partial pivoting
Inside this lecture
From counting rods in the Nine Chapters to Gauss and least squares. Three reversible moves that change the equations but never the answer. The first elimination, seen in both pictures, and the walk from Lecture 4a in disguise. Upper triangles and back substitution. Pivots as units of new information, row exchanges, and the augmented matrix. Every move a matrix, and E A = U. Multiply the pivots: the determinant, as area and volume. Zero pivots that report no answer or infinitely many, and nearly zero pivots that destroy sixteen digits of precision. The recipe, revealed, and a new patient predicted.
Still developing
- 05
The machine and its spaces
Matrices as machines that move the whole of space. Span, independence and basis, made precise. The column space and the null space. Undoing the machine: inverses and LU. Rank, and the four fundamental subspaces that organise everything.
- ··
Orthogonality
Projections and least squares. Gram–Schmidt and QR. The dot product, met with a purpose. Linear regression, built from first principles.
- ··
Eigenvalues
Determinants. Eigenvalues and eigenvectors, diagonalisation, powers of a matrix. Symmetric and positive definite matrices. Change of basis.
- ··
Decompositions
The singular value decomposition. PCA, low-rank approximation, the pseudoinverse.
- ··
Beyond the classical course
Matrix calculus and backpropagation. Norms, conditioning and numerical stability. The geometry of embeddings. The linear algebra inside attention.
From Lecture 3
A x is a mix of the columns of A.
Turn the dials. Watch b being built, one column at a time.
A times x equals 4, 13, 13.
b = 2 col₁ + 1 col₂ + 3 col₃
With gratitude
Professor Gilbert Strang taught the world that linear algebra is not a list of rules but a way of seeing. Thank you, Professor Strang.
The complete volume.
Notes, problems, and a way to know you truly understood. Open lectures stay free.