Beautifully produced and genuinely deep. The reader experience makes it easy to keep going for hours.

Build Decision Trees from Scratch
Grow classification and regression trees by hand.
Build decision trees from an empty file: Gini impurity, best-split search, greedy recursion, pruning, and sum-of-squared-residuals for regression. Every formula is traced by hand on a toy dataset before it becomes working Python.
Read on your Kindle or e-reader
Download the EPUB and read offline — perfect for the train. Works on Kindle, Kobo, Apple Books & more.
00Foundations4 capsules
Foundations — 4 chapters.
01Why Decision Trees?intuitionfree13 min02The Anatomy of a Decision Treeconceptfree11 min03Classification vs Regression Treesconcept🔒13 min04The Toy Dataset We Will Split by Handconcept🔒11 min01Classification Trees9 capsules
Classification Trees — 9 chapters.
05Starting to Build a Classification Treeconcept🔒11 min06What is Gini Impurity?math🔒10 min07Gini Impurity: A Worked Examplemath🔒12 min08Gini Impurity for Numerical Featuresmath🔒11 min09Choosing the Best Splitintuition🔒12 min10Recursion and Stopping Rulesconcept🔒13 min11Finishing the Classification Treeconcept🔒11 min12Pruning to Fight Overfittingdeep-dive🔒12 min13Code an Entire Classification Tree in Pythoncode🔒13 min02Regression Trees7 capsules
Regression Trees — 7 chapters.
14What are Regression Trees?concept🔒13 min15Variance and SSR as the Split Criterionmath🔒11 min16Building the First Regression Splitintuition🔒12 min17Finishing the Regression Treeconcept🔒15 min18Regression Trees with Multiple Featuresdeep-dive🔒13 min19Code an Entire Regression Tree in Pythoncode🔒13 min20Capstone: Fit and Read a Regression Treeproject🔒10 min03Wrap-Up and Interview Prep3 capsules
Wrap-Up and Interview Prep — 3 chapters.
21Recap: Two Trees, One Algorithmintuition🔒12 min22Interview Prep: Decision Treesconcept🔒10 min23From One Tree to Forests and Boostingdeep-dive🔒11 minRatings & reviews
1,357 readersRare mix of depth and readability. The worked examples are the clearest I have seen on this subject.
I read the free preview on a whim and ended up finishing the whole thing in two sittings. Superb pacing.
Dense but never confusing. Every chapter builds cleanly on the last — you can feel the care in the structure.