top of page
Random Forests (99 Pages)

Random Forests (99 Pages)

$49.00Price

You can already ask an AI to write you a Random Forest. The problem is knowing whether the ensemble is buying you anything — or whether it’s averaging away a variance that was never there, quoting an out-of-bag error resting on too few examples to mean anything, and handing you an importance ranking that’s really just a count of how many distinct values each column happens to have. This is the course that gives you that judgment.


Five parts, one algorithm, no gaps:

  • Part 1 — Intro. How bagging, the random subspace, and out-of-bag estimation — the two randomizations that turn one unstable tree into a committee that agrees with itself — buy stability by making every individual tree deliberately worse. Breiman’s bound, strength against correlation, and why adding trees can never overfit. The intuition before the notation.

  • Part 2 — By Hand. Three complete trees grown with a pencil: fourteen bootstrap draws from a generator small enough to run in your head, two attributes offered at each node and redrawn at the next, the Gini decrease computed for every candidate the node was allowed to see, then the vote and the out-of-bag score. Every count and every fraction on the page. Nothing waved away, nothing left “as an exercise.” You prove the algorithm to yourself.

  • Part 3 — In Excel. The same forest carried to twelve trees in a workbook with no pasted values anywhere — change one label and all twelve trees rebuild in front of you — so you see for yourself what mtry, the number of trees, and the depth limit actually do to the vote, to the convergence curve, and to which attribute comes out on top.

  • Part 4 — In Python. A clean, executable reference implementation that verifies its own arithmetic four ways, including an exhaustive enumeration of every tree of this shape — the known-good version you can check any other code against.

  • Part 5 — With AI. A tested prompt that directs an AI assistant to carry this same algorithm to your problem, plus the understanding to catch it when it’s wrong.


By the end you won’t just have working code. You’ll have followed the algorithm from first principles through a hand calculation, a spreadsheet, and production Python — so when you point an AI at your own classification or ranking problem, you’ll know how to set mtry on purpose, read an importance ranking without being fooled by correlated or many-valued columns, tell whether the vote is actually beating the trees that cast it, and say how many examples an out-of-bag number is resting on. The worked example is one where the forest loses to a single tree, and finding that out by building one carefully is worth more than being told.


Written for practicing engineers and STEM professionals who’d rather understand a method than trust a black box.

    bottom of page