Log inStart free
LESSON 4.10 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Feature transformations for linear models

Watch new features bend a straight-line model around three patterns.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 4.10 · FEATURE BAY3 WEIGHTS · TRAIN 23/48 · NEW 50%
01
Stage 1 of 6 · Raw features
A linear model adds each feature times its weight. With only x₁ and x₂, the decision boundary is a straight line.
Explain it simply

Each point has two features: x₁ across and x₂ up. The model multiplies each feature by a weight and adds them into a score. A score of 0.5 or more means class 1. The quadrants need two lines, so only 23 of 48 points are right.

A straight boundary splits the plane. 23 of 48 training points are right. The score line shows both classes mixed.

point: filled class 1, hollow class 0weightscore, predicted class 1wrong predictiontrue rule
input planefeatures of P × weightsscore−1−10011x₁x₂PP = (0.90, 0.81) · class 1score s0.49< 0.5 → predicted class 0wrong11×0.50=0.50x₁0.90×0.01=0.01x₂0.81×−0.02=−0.02class 0class 1predict 1predict 000.51input planefeatures of P × weightsscore−1−10011x₁x₂PP = (0.90, 0.81) · class 1score s0.49< 0.5 → predicted class 0wrong11×0.50=0.50x₁0.90×0.01=0.01x₂0.81×−0.02=−0.02class 0class 1predict 1predict 000.51
Toy: 48 points · 3 rules · one linear model, least squares on 0/1 labels · 1600 new points
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
s=w0+w1 x1+w2 x2\sy{s}{out}{s} = \sy{w}{param}{w_0} + \sy{w}{param}{w_1}\,\sy{x}{data}{x_1} + \sy{w}{param}{w_2}\,\sy{x}{data}{x_2}
s=0.50+0.01⋅0.90+(−0.02)⋅0.81=0.49<0.5⇒class 0\sy{s}{out}{s} = 0.50 + 0.01\cdot 0.90 + (-0.02)\cdot 0.81 = 0.49 < 0.5 \Rightarrow \text{class } 0

The score adds each feature times its weight; 0.5 or more means class 1.

Common mix-ups

MYTHA curved boundary needs a nonlinear model.

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

Predict, then reveal
3 CHECKS · PRO
Q01With the ring, does the interaction x₁x₂ fix the boundary?

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 2 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.