datarekha
Section 4 chapters · 37 of 37 lessons

Math for ML

The math that actually shows up in machine learning — explained with numpy, code, and the geometric intuition that finally makes it click.

The Math for ML journey 0 / 37 completed
  1. Chapter 01

    Linear Algebra

    12 lessons
  2. 01 Why linear algebra matters Data lives in matrices, a model is a function of vectors, and NumPy is just linear algebra you can run. Meet the four operations that almost every… Beginner4 min
  3. 02 Vectors A vector is an arrow in d-dimensional space. Once you see that, similarity, projection, and embeddings all click into place. Beginner6 min
  4. 03 Norms & distances A vector has a direction and a size — and ML constantly needs to measure both: how big is this vector (a norm) and how far apart are two of them (a… Intermediate7 min
  5. 04 Matrices as transformations A matrix is two things at once — a table of numbers and a function that warps space. ML leans on both readings constantly. Intermediate7 min
  6. 05 Matrix multiplication Element-by-element formulas don't stick. Rows-times-columns and shape arithmetic do. Here's how matmul actually works in ML code. Intermediate7 min
  7. 06 Tensor operations Scalars, vectors, and matrices generalize to tensors — n-dimensional arrays — and every ML framework is, underneath, a tensor library. A neural net… Intermediate7 min
  8. 07 Linear systems & RREF Almost every closed-form model fit is a linear system in disguise. Gaussian elimination is the algorithm that solves it — and tells you whether a u… Intermediate9 min
  9. 08 Rank, independence & basis When does a feature add real information, and when is it just a copy of the others? Span, independence, basis, and rank are the four ideas that ans… Intermediate8 min
  10. 09 Orthogonality & least squares You can't fit noisy data exactly — so you get as close as possible. "As close as possible" is a projection, and the magic is that the leftover erro… Intermediate8 min
  11. 10 Eigenvalues & eigenvectors Some directions a matrix only stretches — it doesn't rotate them. Those directions are the secret structure inside data, covariance, and PageRank. Advanced8 min
  12. 11 Singular Value Decomposition Every matrix — any shape, any contents — factors into a rotation, a stretch, and another rotation. That single fact powers PCA, recommender systems… Advanced9 min
  13. 12 PCA from scratch Dimensionality reduction in five lines. Center, covariance, eigendecompose, project. Then plot your 50-dim data in 2D. Advanced9 min
  14. Chapter 02

    Calculus & Optimization

    7 lessons
  15. 13 Derivatives & tangents Derivatives tell you which way to move and how far. That's everything gradient descent needs. Here's the calculus you actually use, no textbook pro… Beginner6 min
  16. 14 Partial derivatives When a loss has many parameters, you take a derivative with respect to each one. Stack them into a vector and you have the gradient — the heart of… Intermediate6 min
  17. 15 Gradient descent Every neural net is trained by walking downhill on a loss surface. Here's how that walk actually works. Intermediate9 min
  18. 16 Backpropagation foundations Backprop is not a new algorithm. It's the chain rule applied to a graph, computed in the right order. Here it is on a tiny network, by hand. Advanced9 min
  19. 17 Jacobian, Hessian & Taylor Gradient descent only uses the slope. But every loss surface also has curvature — and the Jacobian, the Hessian, and the Taylor expansion are how y… Advanced9 min
  20. 18 Convexity "Convex loss" is the quiet reason classical ML just works and deep nets need babysitting. Convexity is the guarantee that downhill always leads hom… Intermediate8 min
  21. 19 Lagrange multipliers Most ML optimization comes with strings attached — keep the weights small, keep the probabilities summing to one, classify everything correctly. La… Advanced9 min
  22. Chapter 03

    Probability & Statistics

    15 lessons
  23. 20 What is probability A random variable, the rules of probability, independence, conditioning, expectations. The ideas behind every classifier output and every A/B test. Beginner5 min
  24. 21 Bayes theorem A formula for updating your beliefs when new evidence arrives. Powers spam filters, A/B testing, and a chunk of modern AI. Intermediate7 min
  25. 22 Distributions you should know Bernoulli, Binomial, Uniform, Normal, Exponential. Each one models a different real-world situation. Sample from them, plot them, recognize them in… Intermediate8 min
  26. 23 Sampling methods Two recurring needs in ML: draw samples from a distribution, or estimate an expectation you can't integrate. Monte Carlo, inverse-transform, reject… Advanced8 min
  27. 24 Stochastic processes A random variable is one random number; a stochastic process is a whole sequence of them indexed by time — a random function. Markov chains, statio… Advanced8 min
  28. 25 Covariance & correlation Variance measures how one feature spreads; covariance measures how two move together; correlation puts it on a clean −1 to 1 scale. Pack them into… Intermediate8 min
  29. 26 The multivariate Gaussian The bell curve, generalized to many dimensions — and the most important distribution in all of ML. A mean vector and a covariance matrix describe i… Advanced8 min
  30. 27 Central limit theorem Average enough independent samples — from ANY distribution — and the result is normal. This is the proof behind the bell curve's ubiquity, and the… Intermediate6 min
  31. 28 Estimation & confidence intervals You never see the true parameter — only an estimate from a finite sample. Estimators, standard error, and confidence intervals are how you say how… Intermediate8 min
  32. 29 Hypothesis testing H₀, p-values, t-tests — what they actually mean, when to use them, and why a 'significant' result isn't proof. The grammar of turning 'is this diff… Intermediate8 min
  33. 30 A/B testing H0, H1, p-values, sample size, the two-proportion z-test. The applied statistics every data scientist and PM runs — without the textbook fog. Intermediate7 min
  34. 31 Maximum likelihood & MAP Why is the loss for regression squared error, and for classification cross-entropy? Both fall out of one principle — maximum likelihood — and addin… Advanced9 min
  35. 32 Entropy & information theory Entropy measures surprise — the floor on how many bits it takes to encode outcomes. From it flow cross-entropy (your classification loss), KL diver… Intermediate8 min
  36. 33 KL Divergence How far is one probability distribution from another? KL divergence answers that — it is the engine behind cross-entropy loss, VAEs, distillation,… Advanced8 min
  37. 34 Simpson's Paradox A trend that holds in every subgroup can reverse when the groups are combined. The cause is always a lurking variable — and missing it flips your c… Intermediate8 min
  38. Chapter 04

    Numerical & Applied Math

    3 lessons
  39. 35 Numerical stability On paper, math is exact. On a computer it runs in finite-precision floating point, where exp(1000) is infinity, log(0) is minus-infinity, and a tho… Advanced8 min
  40. 36 The Fourier transform Any signal is a sum of sine waves of different frequencies. The Fourier transform converts between the time domain (the wave) and the frequency dom… Advanced8 min
  41. 37 Graph theory A graph is things plus the relationships between them — nodes and edges. It's where discrete structure meets linear algebra: the adjacency matrix t… Advanced8 min
  42. End of section 0 / 37 complete

    Make it stick — pass every quiz.

    Each lesson has a short quiz at the bottom. Passing the quiz is what marks the lesson complete and counts toward your certificate.

FAQCommon questions

Math for ML — frequently asked questions

Straight answers to the questions people ask most about math for ml.

How much math do I really need for machine learning?

Enough to reason, not to derive everything from scratch: linear algebra (vectors, matrices, dot products), the basics of calculus (gradients and the chain rule), and probability and statistics (distributions, expectation, Bayes). You can start applying models with less and deepen the math as you go.

Why is linear algebra so important for ML?

Data is represented as vectors and matrices, and nearly every model — from linear regression to neural networks — is built on matrix multiplication. Linear algebra is the language that makes these operations fast and lets you reason about transformations, projections, and dimensionality.

What is a gradient, intuitively?

A gradient is the vector of partial derivatives that points in the direction of steepest increase of a function. Training follows the negative gradient downhill to reduce the loss — that's gradient descent — and the gradient's size tells you how steep the slope is at the current point.

What's the difference between probability and statistics?

Probability reasons forward — given a known model, how likely is an outcome. Statistics reasons backward — given observed data, what model or parameters likely produced it. ML uses both: probability to define models, statistics to fit and evaluate them.

What is Bayes' theorem used for?

Bayes' theorem updates a prior belief into a posterior after seeing evidence, by weighing how likely the evidence is under each hypothesis. It underpins spam filters and medical-test interpretation, and it explains why a positive result on a rare-condition test can still mean low actual risk.

Skip to content