LESSON 4.15 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
L1, L2 and elastic net
Watch a penalty pull two weights toward 0, and see which ones get there.
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.15 · WEIGHT BAYleast squares (2.02, 0.32) · MSE 1.31
01
Stage 1 of 6 · Least squares
Least squares picks ŵ = (2.02, 0.32): the lowest training mean squared error. Each ring joins weights with equal error.
Explain it simply
Each spot on the map is one choice of the two weights, w1 and w2. The shade shows the training error for that choice. Least squares takes the lowest spot, ŵ. Both features were scaled to the same spread first, so a penalty treats both weights fairly.
The map shows the training error over the weights w1 and w2. The lowest point is ŵ = (2.02, 0.32), with an error of 1.31. The chart shows the 12 training points; their correlation is −0.13.
data point, ρweights and penaltyerrorbest λring of equal error
Toy: 12 training points · 100 validation points · 2 standardized features
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
Least squares picks the weights with the lowest mean squared error.
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.