Log inStart free
LESSON 4.25 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Voting, stacking and blending

Watch three classifiers vote, then watch a meta-learner learn which one to trust.


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/mo
EXPLAINER · 4.25 · ENSEMBLE BAYTEST RIGHT: LR 20 · TREE 18 · K-NN 5 21
01
Stage 1 of 6 · Three base models
Three base models learn from the same 24 points. Each one misses different test points.
Explain it simply

Three different models learn from the same 24 dots and squares. Logistic regression draws a straight line, the tree draws boxes, and k-NN follows the nearest points. Each column of the table is a test point. The models get 20, 18, 21 of 24 right, but they miss different points.

Three base models map the plane. On the 24 test points, LR gets 20 right, tree gets 18 right, k-NN 5 gets 21 right.

points: dot class 1, square class 0probability of class 1, ensemble resultweightswrong predictionfolds and grid
base modelsensemble1 · logistic regression2 · decision tree3 · k-NN, k = 524 test points24 test pointsclasstest1 LR20/242 tree18/243 k-NN 521/240.45 · 1.00 · 1.00test points right, of 24LR20tree18k-NN 521base modelsensemble1 · logistic regression2 · decision tree3 · k-NN, k = 524 test points24 test pointsclasstest1 LR20/242 tree18/243 k-NN 521/240.45 · 1.00 · 1.00test points right, of 24LR20tree18k-NN 521
Toy: two moons · 24 training and 24 test points · 3 base models · a 32 × 20 grid map
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
pm(x)=P(y=1∣x),y^m=[ pm>0.5 ]\sy{p}{out}{p_m}(\sy{x}{data}{\mathbf{x}}) = P(y = 1 \mid \mathbf{x}),\quad \hat y_m = [\,p_m > 0.5\,]
test point 6: p1=0.45, p2=1.00, p3=1.00\text{test point 6}:\ p_1 = 0.45,\ p_2 = 1.00,\ p_3 = 1.00

Each model gives a probability of class 1 and predicts 1 above 0.5.

Common mix-ups

MYTHAdding more models to a vote always helps.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With three similar k-NN models, does the hard vote beat the best single model?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

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.