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.

Prefer to just start? Try a full lesson free — no card, no account →

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 26 languages, with the Foundations course and six full sample lessons free to try alongside whichever resource you're already using.

Frequently asked questions

How much linear algebra do I need for machine learning?

Less than a full pure-maths degree, and more than "just matrix multiplication." The working core is about six connected groups: vectors and geometry (dot products, norms, span, basis), matrices as linear maps, solving Ax = b (rank, null space, inverses), eigenvalues and eigenvectors, matrix factorisations (especially the SVD, which powers PCA and low-rank methods like LoRA), and norms/inner products/projections. That's roughly 26 topics — you can safely skip Cramer's rule, permutation-based determinants and most abstract vector-space theory.

Is 3Blue1Brown enough to learn linear algebra for ML?

It's the best resource for intuition, but not enough on its own. The Essence of Linear Algebra series builds a beautiful geometric picture of transformations and eigenvectors, but it has no exercises, so retention fades unless you practise elsewhere. Pair it with graded practice — watch the video for the "aha," then work the same topic until it's fluent, not just familiar.

Do I need linear algebra before deep learning?

Yes — every layer of a neural network is a matrix multiplication, and most shape-mismatch bugs are a linear-algebra fact you didn't quite have. You need matrices as linear maps, matrix multiplication, broadcasting and tensor shapes, and ideally eigenvalues and the SVD. You can learn it alongside your first backprop tutorials rather than strictly before them.

What's the fastest way to actually learn and remember it?

Combine three modes: 3Blue1Brown for visual intuition, a rigorous course like MIT OCW 18.06 (Gilbert Strang) for depth, and hands-on graded practice for retention. Watching and reading build familiarity; only doing problems with immediate feedback turns it into fluency you can use.

Is Mathematics for Machine Learning free?

The Foundations course (29 lessons) is free forever, and seven full sample lessons — including Eigenvectors & Eigenvalues from the Linear Algebra course — are free with no card or account. Pro unlocks all seven advanced courses from £42/year with a 7-day free trial, in your local currency at checkout.

About · Terms · Privacy