How Linear Algebra Powers ML
What's a Vector?
Numbers with direction — the building blocks of data
A vector is just a list of numbers — here, two numbers [x, y] that define an arrow. The arrow has a magnitude (length) and a direction (angle). Drag the sliders to see how changing the components changes the arrow.
Step 1 of 6: What's a Vector?
Numbers with direction — the building blocks of data
A vector is just a list of numbers — here, two numbers [x, y] that define an arrow. The arrow has a magnitude (length) and a direction (angle). Drag the sliders to see how changing the components changes the arrow.
Step 2 of 6: Vectors as Data
Every data point is a vector in disguise
Every row in a dataset is a vector in disguise. A person with height 165 and weight 58 is just the point [165, 58] in 2D space. Click a row or a point to see the connection.
Step 3 of 6: The Dot Product
Measuring similarity between vectors
The dot product measures how much two vectors point in the same direction. When vectors are aligned (0°), it's maximum. At 90°, it's zero — the vectors are unrelated. At 180°, they point in opposite directions.
Step 4 of 6: What's a Matrix?
A grid of numbers that transforms data
A matrix is a grid of numbers that transforms space. The dashed square is the original; the solid shape is after transformation. Try the presets to see rotation, scaling, and shearing in action.
Step 5 of 6: Matrix Multiplication
Combining transformations step by step
Matrix multiplication computes each output cell as a dot product of a row from A and a column from B. Step through each cell or hit Auto to watch the whole multiplication unfold.
Step 6 of 6: Why It Matters for ML
Layers are just matrix multiplications
A neural network layer is just a matrix multiplication followed by an activation function. The input vector is multiplied by a weight matrix to produce the output. Every layer in every neural network works exactly like this — linear algebra is the engine of ML.