Skip to content

Linear Algebra — Overview

Linear algebra is the language of data. A grayscale image is a grid of numbers. A user’s music taste is a list of numbers. A sentence, once embedded, is a vector of numbers. The moment you represent something as an array of numbers, linear algebra gives you the tools to measure it, combine it, and transform it — which is exactly what every machine learning model does.

This chapter follows Chapter 2 of Mathematics for Machine Learning. Here’s the whole territory on one map before we walk through it piece by piece.

The concept map

Everything in this chapter connects. Vectors are the atoms; every other idea is a way of combining, relating, or transforming them.

diagram Diagram mermaid

(Adapted from Figure 2.2 of the book — the same mind map the authors use to open the chapter.)

The through-line

Read the chapter as one continuous story:

  1. Systems of Linear Equations — the original problem: many constraints, find the unknowns. This is where linear algebra was born.
  2. Matrices — a compact notation that turns a messy system into the single equation Ax=bA\mathbf{x} = \mathbf{b}. Matrices both store data and transform it.
  3. Solving Systems — Gaussian elimination, the algorithm that actually finds the answer (and the matrix inverse along the way).
  4. Vector Spaces — zoom out: what is the set of all vectors you can build? The rules (closure) that make a collection well-behaved.
  5. Linear Independence — which vectors carry new information, and which are redundant combinations of the others?
  6. Basis and Rank — the smallest set of vectors that builds the whole space, and a single number measuring how much a matrix “spans.”
  7. Linear Mappings — functions that preserve structure. Every such function is a matrix, and every matrix is such a function.
  8. Affine Spaces — lines and planes shifted off the origin — the geometry behind regression lines and decision boundaries.

Where each idea shows up in ML

Linear algebra ideaMachine learning payoff
Vectors in Rn\mathbb{R}^nEvery data point, feature vector, and embedding
Matrix multiplicationA neural network layer is y=Wx+b\mathbf{y} = W\mathbf{x} + \mathbf{b}
Solving Ax=bA\mathbf{x}=\mathbf{b}Closed-form linear regression
Linear independenceDetecting redundant / collinear features
Basis & rankPCA, low-rank compression, feature reduction
Linear mappingsRotations, projections, the core of every layer
Affine spacesRegression lines & SVM decision boundaries

The one habit to build

Whenever you meet a new object in this chapter, ask three questions:

  • What is it? (a definition you could write down)
  • What does it look like? (a picture in 2-D or 3-D)
  • Why does ML care? (where it shows up in a real model)

Every page answers all three. Start with Systems of Linear Equations.

If this helped you, consider buying me a coffee ☕

Buy me a coffee

Was this page helpful?

Let us know how we did