LESSON 4.21 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Growing and pruning trees
Watch a tree split two moons, grow too deep, and get pruned back.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 4.21 · TREE BAY1 LEAF · MEAN 0.5 · TRAINING MSE 0.25
01
Stage 1 of 6 · Predict the mean
Each dot has y = 1 and each square has y = 0. A regression tree starts as one leaf that predicts their mean.
Explain it simply
You see 40 points from two moons. Each dot gets the number 1, and each square gets 0. Before any question, the best single guess is the mean, 0.5: the share of dots, 20 of 40. Gradient boosting later fits trees like this one to the errors of earlier trees.
40 training points, 20 dots and 20 squares. One leaf covers the plane and predicts 0.5. The training MSE is 0.25.
points: dot y = 1, square y = 0split, g and αleaf share of dotserror, missed held-out pointcut by pruning
Toy: two moons (4.C1) · 40 training points, y = 1 dot, 0 square · 1000 held-out points
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The leaf predicts the mean, which is the share of dots.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.