The recurring question

What changed in the data, the model, or the error—and why does the next algorithmic choice help?

01Start here

Foundations

Understand one decision tree deeply

Outcome: trace a prediction, explain how a split is chosen, recognize overfitting, and know what a single tree can and cannot tell you.

  1. Invent the first splitTurn labeled examples into one useful yes/no question.Available
  2. Gini and entropyMeasure how mixed a group is and derive information gain.Available
  3. Grow a full treeRepeat the same split rule recursively from root to leaves.
  4. Control overfittingUse depth, leaf size, and pruning to trade fit for generalization.
  5. Regression treesReplace class votes with numeric averages and squared error.
  6. Feature importanceRead split-based importance while learning its limitations.
02Practice

Implementation labs

Build the mechanism from scratch

Theory and implementation use separate lessons so code can deepen the idea without interrupting the conceptual path.

  1. Search for a splitGenerate thresholds, partition rows, score candidates, and break ties.
  2. Build recursivelyTurn the one-level stump into a complete classifier and regressor.
  3. Test and visualizeCheck invariants and connect training traces to interactive views.
03Parallel trees

Bagging

Make unstable trees cooperate

Outcome: explain how resampling and averaging reduce variance, then reconstruct the central idea behind a random forest.

  1. Why use many trees?Expose how a small data change can reshape one tree.
  2. Bootstrap and baggingTrain varied trees in parallel and aggregate their votes.
  3. Random forestsAdd feature sampling to make the trees less alike.
04Sequential trees

Boosting

Let each tree repair the current model

Outcome: explain boosting as additive error correction and predict how learning rate, tree size, and ensemble length change the fit.

  1. Learn from mistakesTurn residual errors into the next tree's learning problem.
  2. Gradient boostingConnect repeated correction to optimization.
  3. Tune the ensembleBalance learning rate, depth, and number of trees.
05Transfer

Applications

Choose, diagnose, and explain a model

Outcome: carry the same mechanisms into unfamiliar datasets, notice important failure modes, and defend the choice of model.

  1. Diagnose a modelInvestigate leakage, imbalance, instability, and extrapolation.
  2. Explain predictionsCompare a readable path with global and local explanation tools.
  3. Case studiesRun a small tabular problem from data definition to error analysis.
  4. Trees in reinforcement learningStudy value approximation and policy failure without hiding the domain mapping.