Linear algebra for machine learning: what to learn, the best free resources, and where to practise

A short, honest guide for anyone who searched that exact phrase: what the subject actually covers for ML, two genuinely excellent free ways to learn it, and the one thing both leave out.

What linear algebra ML actually uses

Not all of linear algebra matters equally for machine learning. You can skip Cramer's rule, determinants defined by permutations, and most abstract vector-space theory, and still be completely fluent in the maths every model actually runs on. What you do need breaks into six connected groups of ideas.

Vectors and geometry. A vector read two ways at once: as a list of numbers, and as an arrow in space. The dot product, both algebraically (a·b = Σ aᵢbᵢ) and geometrically (|a||b|cos θ, projection, orthogonality). The norms that actually show up in ML code — L1, L2 and L∞ — and what it means to normalise a vector. Then span and linear combinations, followed by linear independence and basis: what a set of vectors can reach, and the minimal set needed to reach it.

Matrices as linear maps. The reframe that makes everything else click: a matrix is not a grid of numbers, it's a function, f(x) = Ax, that rotates, scales, reflects or projects space. From there: matrix multiplication and why it doesn't commute, the affine map Wx + b that every dense layer actually computes (the "bias term" b is what technically makes it affine rather than purely linear), elementwise operations and broadcasting, how data shapes and tensors work once you're batching examples, the transpose, one-hot vectors as embedding-table lookups, and special matrices such as the identity, diagonal and orthogonal matrices.

Solving Ax = b. Reading a linear system as geometry — the intersection of hyperplanes, not just row-reduction bookkeeping — then Gaussian elimination itself, and the trio of rank, null space and column space that tells you what a matrix can and can't express. Finally, when a matrix inverse exists, and when you shouldn't bother computing one.

Eigenvalues and eigenvectors. The directions a transformation only stretches, never rotates, arguably the single most useful idea in the subject for ML. From there: diagonalisation, and the well-behaved special case of symmetric matrices (real eigenvalues, orthogonal eigenvectors, the spectral theorem) — exactly the shape a covariance matrix or a Hessian takes.

Matrix factorisations. The singular value decomposition, A = UΣVᵀ, read geometrically as rotate, then scale, then rotate again — the engine behind PCA, low-rank compression and techniques like LoRA. Then PCA itself, built directly from the SVD, and least squares, read as a projection onto a column space.

Norms, inner products, projections. Matrix norms (Frobenius and spectral), projecting a vector onto the span of a matrix, and quadratic forms xᵀAx — the object that decides whether a critical point is a minimum, a maximum or a saddle.

That's the real shape of the subject for ML: not "all of linear algebra," but a specific, connected subset of it, roughly 26 topics deep once you count the newer material like broadcasting and tensor shapes that older textbooks skip.

The two best free resources for learning it

3Blue1Brown's Essence of Linear Algebra is, deservedly, one of the most recommended maths resources on the internet. Grant Sanderson's short animated series rebuilds vectors, linear transformations, determinants and eigenvectors from pure geometric intuition, with almost no notation-heavy setup. If you want to actually see why a matrix is a transformation, or why an eigenvector is special, before you ever manipulate one algebraically, nothing does it better. It suits anyone at any stage: a total beginner building first intuition, or someone who's done the algebra for years and never quite pictured it.

MIT OpenCourseWare's 18.06 Linear Algebra, taught by Gilbert Strang, sits at the other end of the spectrum: a full, rigorous university course, free, with recorded lectures, problem sets and exams. It's slower and far more thorough than 3Blue1Brown, properly proving results and working through real computations by hand, covering everything from elimination to the four fundamental subspaces to the SVD. It suits someone who wants the complete university-grade course rather than just the intuition, and who's ready to sit through real lectures and do the problem sets.

Mathematics for Machine Learning (math4ml.co) is an independent course and is not affiliated with, endorsed by, or connected to 3Blue1Brown (Grant Sanderson) or MIT OpenCourseWare. We simply think both are excellent, and want to help you get the most out of them.

The gap both leave: watching isn't doing

Here's the honest limitation of both, brilliant as they are. 3Blue1Brown builds intuition beautifully but has no exercises: you watch, you nod along, and the retention fades unless you go and practise somewhere else. 18.06 has real problem sets, but they're pen-and-paper and ungraded, with nobody telling you right away whether your instinct for "is this matrix invertible" is actually correct.

What we add: a Linear Algebra course of 26 lessons covering exactly the topics above, where every lesson has an interactive figure you drag with your own hands — rotate the transformation, watch the eigenvector move, drag the projection — plus unlimited auto-graded practice that tells you right away, not eventually, whether you've actually got it.

You can try a full lesson free right now, no card or account needed:

Try "Eigenvectors & Eigenvalues" free → Start Foundations free →

If the prerequisites feel shaky — basic algebra, functions, working with numbers confidently — the Foundations course (29 lessons) is free forever, no card or account required, and it's the right place to build the ground floor before any of the above.

Using them together

These aren't rivals. A combination that works well: watch the matching 3Blue1Brown video first for the geometric "aha," then come here and work the same topic's interactive lesson and practice problems until it's fluent, not just familiar. When you want the full rigorous treatment — proofs, harder computations, the complete mathematical structure — that's exactly what 18.06 and Strang's lectures are for, and our practice is a quick way to warm up on a topic (eigendecomposition, say, or the SVD) right before you sit down with the matching lecture.

Video for intuition, hands-on practice for retention, the full university course for rigour: the three aren't competing, and Mathematics for Machine Learning works entirely in the browser, in 21 languages, with the Foundations course and six full sample lessons free to try alongside whichever resource you're already using.

About · Terms · Privacy