Phase 0: Mathematical Foundations¶
Months 1–2 | ~80–120 hours total | The bedrock you will stand on for the next 11 months¶
Mathematics is not the prerequisite to machine learning. It is machine learning. Every loss function is an expectation under a probability model. Every optimization step is a gradient calculation. Every dimensionality reduction is a linear transformation. When you understand this, Phase 0 stops feeling like homework and starts feeling like acquiring the language that every paper, every architecture, and every debugging session speaks. This phase does not teach you tools — it rewires how you think about data, uncertainty, and change.
You have one year of applied ML experience. That means you have intuitions worth preserving and habits worth interrogating. This phase will explain why things you already do work, and why some things you think work are actually broken.
What This Phase Builds¶
By the end of Month 2, you will have the mathematical substrate to:
Read an ML paper’s methods section without skipping the equations
Implement any gradient-based optimization from scratch
Understand what a model is actually learning (a probability distribution over outputs)
Build PCA, linear regression, and naive Bayes from first principles — no library calls
Know when a loss function is appropriate and when it’s a lie
Math Dependency Graph¶
The four pillars are not independent. They form a directed dependency chain, and you must respect it.
Why this order matters: Linear algebra gives you the objects (vectors, matrices, transformations). Calculus gives you the dynamics — how those objects change. Probability gives you the language of uncertainty that wraps all of it. Information theory is the natural conclusion — once you model uncertainty, you need to measure it.
Skipping ahead to probability before linear algebra means you’ll understand distributions but not why covariance matrices have the geometric properties they do. Skipping calculus before optimization means gradient descent is a recipe rather than a derived necessity.
Weekly Schedule (Suggested)¶
Week |
Focus |
Hours/Week |
|---|---|---|
1 |
Vectors, matrices, dot products, matrix ops |
10–12 hrs |
2 |
Matrix decompositions, eigenvalues, SVD geometry |
10–12 hrs |
3 |
Derivatives, chain rule, partial derivatives |
10–12 hrs |
4 |
Gradients, Jacobian, Hessian, gradient descent |
10–12 hrs |
5 |
Probability distributions, Bayes theorem |
10–12 hrs |
6 |
MLE, MAP, expectation, KL divergence |
10–12 hrs |
7 |
Information theory, entropy, cross-entropy |
8–10 hrs |
8 |
Phase projects (PCA, gradient descent viz, probability calibration) |
12–15 hrs |
Total: ~80–95 hours at the low end, ~110 hours if you go deep.
Exit Criteria¶
You are done with Phase 0 when you can do all of the following without looking anything up:
Explain eigenvectors geometrically and state why they appear in PCA
Write the chain rule for a 3-layer composition by hand
Derive the gradient of mean squared error from scratch (∂L/∂w)
State Bayes’ theorem and correctly identify what the prior, likelihood, and posterior are in a logistic regression problem
Compute the KL divergence between two Gaussians by hand (formula + calculation)
Implement PCA from scratch using numpy (no
sklearn.decomposition) and produce a correct 2D projection of a 4D datasetImplement gradient descent on a toy quadratic loss and verify convergence with a plot
Explain the difference between MLE and MAP estimation and give a concrete ML example of each
If you cannot do these, you are not ready for Phase 1. That is not a criticism — it is a forcing function to prevent you from building a deep learning stack on sand.
What Most People Get Wrong About This Phase¶
They treat it as a checklist, not a language acquisition.
The failure mode is reading about eigenvectors, understanding the definition, checking the box, and moving on — without ever asking “where does this show up when I train a model?” Every concept in this phase has a direct, non-metaphorical connection to ML mechanics. Your job is to find those connections for each concept as you learn it.
Second failure mode: doing all the theory and none of the code. Numpy implementations are not optional extras — they are the verification that you understood the concept. If you cannot implement it, you do not understand it well enough to debug it when something breaks in production.
Third failure mode: spending all 8 weeks on linear algebra. Strang’s MIT 18.06 is 35 lectures. You do not need all 35. You need lectures 1–22 (through eigendecomposition and SVD) and you need to spend the saved time on probability, which is chronically undertaught.
Resources Map¶
Subject |
Primary |
Depth |
Free? |
|---|---|---|---|
Linear Algebra |
Gilbert Strang, MIT 18.06 OCW |
Deep |
✅ |
LA Intuition |
3Blue1Brown “Essence of Linear Algebra” |
Visual |
✅ |
Calculus |
3Blue1Brown “Essence of Calculus” + Stewart Ch.13–16 |
Medium |
Partial |
Probability |
Sheldon Ross “A First Course in Probability” |
Deep |
❌ (~$50) |
Prob/Stats (visual) |
StatQuest with Josh Starmer (YouTube) |
Medium |
✅ |
All-in-one reference |
MML Book (mml-book.github.io) |
Broad/shallow |
✅ |
Community verdict on MML Book: 742 upvotes on r/learnmachinelearning as a roadmap. Universally noted as too shallow to use as primary material. Use it to orient yourself, not to learn from.
File Index¶
File |
Content |
|---|---|
Vectors → matrices → eigendecomposition → SVD. Full treatment with ML connections. |
|
Derivatives → gradients → loss landscapes → gradient descent. |
|
Distributions → Bayes → MLE/MAP → KL divergence. |
|
Entropy → cross-entropy → mutual information. The language of loss functions. |
|
3 concrete projects with full specifications and acceptance criteria. |
Return to 13-Month Roadmap Root · Next: 01_linear_algebra.md