Impurity and Splitting Primitives
Build the low-level tools a decision tree needs: measuring impurity, partitioning data on a feature threshold, and scoring candidate splits.
Build a complete Random Forest classifier from impurity math to a bagged ensemble with bootstrapping and feature subsampling.
Every source step is its own lesson with intuition, concepts, correctly rendered MathJax mathematics, implementation, tests, mistakes, and a checkpoint.
Build the low-level tools a decision tree needs: measuring impurity, partitioning data on a feature threshold, and scoring candidate splits.
Combine the primitives into a recursive tree builder with best-split selection, stopping criteria, and leaf prediction.
Traverse a fitted tree to predict single examples and full datasets.
Add bootstrap sampling of rows and random feature subsets so that individual trees become decorrelated.
Grow many trees on randomized data, aggregate their votes, produce forest-level predictions, and evaluate accuracy.