# 🧮 Mathematics for Machine Learning 1: Linear Algebra Foundations

By Better Wise · Generated by Everwise

Build the linear algebra intuition behind machine learning: see vectors and matrices as transformations, then compute eigenvalues, projections and SVD yourself in NumPy.

- **Level:** Beginner
- **Goal:** Fundamentals
- **Language:** English
- **Focus:** [vectors and norms](/courses?q=vectors%20and%20norms), [matrix operations and transformations](/courses?q=matrix%20operations%20and%20transformations), [eigenvalues and SVD](/courses?q=eigenvalues%20and%20SVD), [geometric intuition](/courses?q=geometric%20intuition), [NumPy practice](/courses?q=NumPy%20practice)
- **Prior knowledge:** High-school algebra (equations, functions), Basic Python or willingness to run short NumPy snippets
- **Practice:** Guided exercises
- **Time:** ~4.8h
- **Voice:** a patient university lecturer who draws every operation as a geometric transformation before touching the algebra
- **Not covered:** Calculus and derivatives, Probability and statistics, Deep learning models

## What you will achieve

By the end of this course you will be able to look at a vector or a matrix and see a picture, not just a grid of numbers. You will build the geometric intuition first, then confirm it with short NumPy snippets you run yourself.

Concretely, you will be able to:

- Describe a vector as an arrow, as a point, and as a NumPy array, and move between those three views without confusion.
- Measure the size of a vector with norms and the distance between two vectors, and explain why different norms give different answers.
- Compute a dot product and a cosine similarity, and use them to judge how alike two vectors are, the core operation behind many recommendation and search systems.
- Read a matrix as a transformation of space, and read matrix multiplication as running one transformation after another.
- Use the inverse, rank, and span to reason about whether a system of equations has a solution, and how many.
- Change basis: describe the same vector in a different set of axes and understand what stays the same.
- Project one vector onto another and see the least squares idea as the best approximation when no exact answer exists.
- Find eigenvectors, understand eigen-decomposition, and take a first look at SVD as a way to break a matrix into simple, interpretable pieces.

Every one of these abilities is practiced in NumPy, so the ideas stick to real computation.

## Who this course is for

This is a beginner course. It assumes two things only:

- High-school algebra: you are comfortable with equations and functions.
- Basic Python, or the willingness to run short NumPy snippets. You do not need prior NumPy experience; the snippets are small and explained as we go.

You do not need a linear algebra background, a statistics background, or any calculus. If you have met matrices before but never felt you understood them, this course is designed for exactly that gap.

## Course roadmap

The course runs across three modules and twelve lessons.

**Module 1: Vectors, Norms and Similarity**

- **1.1 Vectors as Arrows, Points, and NumPy Arrays.** The same object seen three ways, so the geometry and the code line up.
- **1.2 Norms and Distances: Measuring Vector Size.** How to put a number on length and closeness, and when each norm is the right tool.
- **1.3 Dot Product and Cosine Similarity.** The dot product as a measure of alignment, and cosine similarity as its normalized form.
- **1.4 Checkpoint: Vectors and Similarity.** A short quiz to confirm the first module before moving on.

**Module 2: Matrices and Transformations**

- **2.1 Matrices as Transformations and Matrix Multiplication as Composition.** A matrix as an action on space, and multiplication as chaining actions.
- **2.2 Inverse, Rank, and Span.** What it means to undo a transformation, and how rank and span describe what a matrix can and cannot reach.
- **2.3 Basis and Change of Basis.** Choosing a different set of axes and translating cleanly between them.
- **2.4 Checkpoint: Matrices and Transformations.** A quiz covering the second module.

**Module 3: Projections, Eigenvectors and SVD**

- **3.1 Projections and Least Squares Intuition.** Dropping a vector onto a line or plane, and why the closest fit is often the best answer.
- **3.2 Eigenvectors and Eigen-Decomposition.** The special directions a transformation only stretches, and how to find them.
- **3.3 A First Look at SVD.** A first pass at the singular value decomposition, the workhorse behind compression and dimensionality reduction.
- **3.4 Checkpoint: Projections, Eigen and SVD.** A final quiz to close the course.

## How the course works

Each lesson follows a steady rhythm. The lecturer draws the operation as a geometric transformation before any algebra appears, then you see the same idea in a short NumPy snippet, then you practice it in a guided exercise. Theory is kept short and always paired with something you run or draw.

The course mixes four formats:

- **Theory lessons** that build the geometric picture with short explanations and visuals.
- **Practice exercises** where you apply each concept in NumPy, guided step by step.
- **Checkpoint quizzes** at the end of each module to test recall and catch gaps early.
- **A final checkpoint** that ties projections, eigenvectors, and SVD together.

The total pacing estimate is about **290 minutes across 12 lessons**, roughly 20 to 30 minutes per lesson. You can finish the course in a few focused sittings or spread it over a couple of weeks.

How to use it: the modules build on each other, so the intended path is linear. Module 2 assumes the vector and norm ideas from Module 1, and Module 3 assumes matrix transformations from Module 2. If you already know a topic, you can skim its theory and go straight to the exercise and checkpoint quiz to confirm you are solid. If a checkpoint quiz surprises you, revisit that lesson before continuing, because the next module will lean on it.

Start with lesson 1.1, keep a Python notebook open, and run every snippet as you meet it. The geometry will do the rest.

## Contents

- **📐 Vectors, Norms and Similarity**
  - [➡️ Vectors as Arrows, Points, and NumPy Arrays](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/vectors-as-arrows-points-and-numpy-arrays.md)
  - [📏 Norms and Distances: Measuring Vector Size](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/norms-and-distances-measuring-vector-size.md) (sign-in required)
  - [🎯 Dot Product and Cosine Similarity](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/dot-product-and-cosine-similarity.md)
  - [✅ Checkpoint: Vectors and Similarity](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/checkpoint-vectors-and-similarity.md)
- **🔄 Matrices and Transformations**
  - [🧱 Matrices as Transformations and Matrix Multiplication as Composition](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/matrices-as-transformations-and-matrix-composition.md)
  - [🧭 Inverse, Rank, and Span](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/inverse-rank-and-span.md)
  - [🔀 Basis and Change of Basis](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/basis-and-change-of-basis.md)
  - [✅ Checkpoint: Matrices and Transformations](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/checkpoint-matrices-and-transformations.md)
- **🔆 Projections, Eigenvectors and SVD**
  - [📉 Projections and Least Squares Intuition](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/projections-and-least-squares-intuition.md)
  - [🌀 Eigenvectors and Eigen-Decomposition](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/eigenvectors-and-eigen-decomposition.md)
  - [🔍 A First Look at SVD](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/first-look-at-svd.md) (premium content)
  - [✅ Checkpoint: Projections, Eigen and SVD](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/checkpoint-projections-eigen-and-svd.md) (premium content)
- [Course cheatsheet](https://everwise.study/courses/mathematics-for-machine-learning-1-linear-algebra-foundations/cheatsheet.md) (premium content)
