LESSON 4.07 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Categorical encoding
Turn one text column into numbers three ways, and watch a model fit each.
Needs4.06 Feature scaling
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.07 · ENCODING BAYSIZE · 4 CATEGORIES · 12 + 4 ROWS
01
Stage 1 of 6 · Text categories
The size is a categorical feature with 4 categories. A linear model needs a number for each one.
Explain it simply
Each row is one parcel: its size and what it cost to ship. Twelve rows train the model, and four test rows check it. A model multiplies inputs by weights, and you can't multiply the word "XL". So each size needs a number first: that's called encoding.
A table of 12 training parcels and 4 test parcels, each with a size and a cost. The chart shows the costs for each size.
category, cost, codetest rowweightpredictionerror
Toy: 12 training + 4 test parcels · 4 categories · cost = a set mean + seeded noise
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The model needs a number x for each category c.
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.