skipnothing/Math for Machine Learning
UNIT 01

Linear Algebra

Scalars, vectors, matrices, and the directions that matter

This is where the math of ML begins. Once you see vectors as directions and matrices as transformations, every later idea in this curriculum has somewhere to stand.

Loading…
TOPICS
#1

Scalars, Vectors & Matrices

Name a block of numbers as a scalar, vector, or matrix from its layout alone, state its shape without counting entries, and judge whether two shapes line up along a chosen axis before any arithmetic runs.

A thermostat shows one number, a receipt shows a line of them like `[3.50, 2.20, 1.80]`, and a spreadsheet shows a whole grid. Same digits, but the layout alone decides what they mean and which ones your code can combine.

12 min
#2

Matrix Operations

Predict from the shapes alone whether an addition, transpose, or multiply is even legal and what shape it returns, then build a single product cell by pairing one row against one column and summing.

Stack two weekly sales spreadsheets of the same size and you can total them square by square; stack two of clashing sizes and the exact same command, written `week1 + week2` in code, refuses before it adds a single figure.

15 min
#3

Dot Product & Norms

Score how alike two vectors are by pairing their entries and summing, read direction straight off that number's sign, measure a vector two ways with the L1 and L2 norms, and strip length away to leave cosine similarity on a fixed minus-one-to-one scale.

Two friends each rate the same three snacks out of ten, and you want one number for how alike their taste runs; multiply the ratings in pairs, add them up, and `a . b` already holds it.

14 min
#4

Eigenvalues & Eigenvectors

Hunt the few directions a matrix leaves on their own line, read each eigenvalue as a signed stretch factor where positive stretches, negative flips, and zero collapses the line, and see why a data cloud's eigenvectors fall along its natural axes.

Push a plane of arrows through the same matrix and almost every one swings to a new heading, yet a stubborn few, like the arrow reaching to `[2, 1]`, come out pointing exactly the way they went in, only longer.

18 min
UNLOCKS
All units