Skip to Content
03 Maths

Mathematics for ML

Mathematical foundations for the rest of the curriculum. The goal is enough fluency to understand optimization, probability, embeddings, attention, and evaluation without treating them as magic.

This phase is a support layer for the rest of the repo, not a requirement to master every theorem before moving forward. Use it to build enough intuition and fluency to stop later AI topics from feeling opaque.

Folder Map

FolderNotebooksLevelWhat It Covers
foundational/13BeginnerCore math: linear algebra, calculus, probability, gradient descent, info theory, neural net math
3blue1brown/42BeginnerVisual intuition: calculus (12), linear algebra (13), differential equations (8), neural networks (9)
mml-book/24IntermediateMathematics for Machine Learning: course (10), exercises (4), practice labs (10)
cs229-course/18IntermediateStanford CS229: regression, classification, SVMs, learning theory, clustering, RL
islp-book/15IntermediateIntro to Statistical Learning: 13 chapters + practice exercises
mlpp-book/13IntermediateML: A Probabilistic Perspective: Bayesian inference, graphical models, MCMC, EM
dli-book/6IntermediateDeep Learning Interviews: practice labs for logistic regression, info theory, CNNs
slp-book/6IntermediateSpeech & Language Processing: NLP labs from tokenization to transformers
advanced/16AdvancedResearch topics: learning theory, PAC-Bayes, NTK, variational inference, state space models
ml-problem/-ReferenceML problem-solving reference PDF

Total: 153 notebooks across 10 folders

Quick Start

# Start here jupyter notebook foundational/01_linear_algebra_fundamentals.ipynb

Learning Paths

Path 1: Beginner (start here)

Work through the foundational notebooks first. These cover the essentials:

  1. foundational/01 - Linear Algebra
  2. foundational/02 - Calculus
  3. foundational/03 - Probability
  4. foundational/04 - Gradient Descent
  5. foundational/05 - Information Theory
  6. foundational/06 - Statistical Inference
  7. foundational/07 - Neural Network Math

Supplement with 3blue1brown/ notebooks for visual intuition on any topic that feels abstract.

Path 2: ML Engineer

After the foundational pass, build depth in ML theory and algorithms:

  1. mml-book/course/ - rigorous math foundations (linear algebra through optimization)
  2. cs229-course/ - Stanford ML algorithms (regression, SVMs, neural nets, RL)
  3. mml-book/practice-labs/ - hands-on implementation of MML concepts
  4. dli-book/ - deep learning interview math

Path 3: Data Scientist

Statistical and probabilistic foundations:

  1. islp-book/ - statistical learning (regression, classification, resampling, trees, SVMs)
  2. mlpp-book/ - probabilistic perspective (Bayesian inference, graphical models, MCMC)
  3. slp-book/ - NLP and language model foundations

Path 4: Researcher

Graduate-level theory (requires Path 1 + Path 2 as prerequisites):

  1. advanced/ - learning theory, concentration inequalities, PAC-Bayes, NTK
  2. foundational/08 - Advanced Linear Algebra
  3. foundational/12 - Optimization from Scratch

Topic Cross-Reference

Find the same topic at different depths across folders:

TopicBeginnerIntermediateAdvancedPractice
Linear Algebrafoundational/01, 3b1b/linear-algebra/mml-book/01foundational/08mml-labs/01
Calculusfoundational/02, 3b1b/calculus/mml-book/04-mml-labs/04
Probabilityfoundational/03mml-book/05, mlpp/01-mml-labs/05, dli/04
Optimizationfoundational/04mml-book/06, cs229/02advanced/09mml-labs/06
Information Theoryfoundational/05--dli/02
Regression-mml-book/07, cs229/01, islp/03-mml-labs/07
Classification-cs229/04, islp/04-dli/01
SVMs-mml-book/10, cs229/06, islp/09-mml-labs/10
PCA-mml-book/08, cs229/14-mml-labs/08
Neural Networksfoundational/07, 3b1b/neural-networks/cs229/10-11, islp/10-slp/04
Transformers/LLMs---slp/05-06
Bayesian Methods-mlpp/04, mml-book/07advanced/07dli/04
Clustering/GMM-mml-book/09, cs229/13, mlpp/11-mml-labs/09

Source PDFs

Each book folder contains its own PDF:

PDFLocation
Mathematics for Machine Learningmml-book/mml-book.pdf
Stanford CS229 Notescs229-course/cs229.pdf
Intro to Statistical Learning with Pythonislp-book/ISLP.pdf
ML: A Probabilistic Perspectivemlpp-book/ML-Machine-Learning-A-Probabilistic-Perspective.pdf
Deep Learning Interviewsdli-book/2201.00650v2.pdf
Speech & Language Processingslp-book/ed3book_jan26.pdf
ML Problem Solvingml-problem/ml-problem.pdf

Practical Rules

  • Learn the intuition before the notation
  • Re-derive small examples by hand when possible
  • If a symbol-heavy notebook feels abstract, reconnect it to one use case: gradient descent, cosine similarity, cross-entropy, PCA, or attention
  • Do not try to finish every notebook before continuing the curriculum
  • Do not spend weeks on theorem-level depth if your goal is applied AI engineering

How To Use This Phase Well

  • Do one foundational pass first instead of hopping randomly across all ten folders.
  • Use this phase just-in-time when later modules expose a math gap you can name.
  • Prefer targeted reinforcement over exhaustive completion when your main goal is building systems.
  • Return for deeper theory only after you have a concrete reason, such as optimization confusion, evaluation errors, or model architecture questions.

What Comes Next

After the foundational notebooks, continue into:

Then come back here as needed instead of treating this folder as a prerequisite gate.

Last updated on