Free sample chapters
Machine Learning
From Scratch
Most people stop at fit() and predict(), treating algorithms as black boxes.
This book opens every box — ten algorithms rebuilt from first principles, using plain English, accessible mathematics, and clean NumPy code.
The 5-stage framework
Every algorithm in this book follows the same five stages, in the same order — every time. Click any stage to see what it means in practice.
Before any equation or code appears, every algorithm is explained the way you'd describe it to a good friend. If you can't say it in plain English, you don't understand it yet. The intuition is the foundation everything else is built on.
Equations arrive only after the intuition is solid. Each symbol is named, motivated, and connected to the English you already understand. You'll see why the formula is shaped the way it is — not just how to apply it.
Every algorithm is implemented from scratch using NumPy — no ML library shortcuts. Writing it yourself is the proof that you understand it. No black box, no magic. Just what you already know, translated directly into code.
Your implementation runs against Scikit-learn or PyTorch on real datasets. If the outputs match, you built it correctly. If they don't, the diff tells you exactly what you missed. Trust, but verify.
Every chapter closes with field notes: where the algorithm shines, where it struggles and which hyperparameters actually matter. The gap between understanding and applying well in practice.
← → turn pages · click viewer to focus