Before you can read the parent note, you must be able to read its symbols. This page builds every one of them from nothing — no algebra assumed. We go slowly, in the order they depend on each other, so that by the last section every letter — including the smoothed encoding the parent calls TEsmooth(c) — already means something to you.
Picture a spreadsheet. Each row is one example (one house, one student). Each column is one feature. A categorical column stores words.
Figure s01. A data table. The yellow header names each column (feature). The blue column holds words — a categorical feature. Reading down that blue column, notice NYC appears more than once: rows repeat, but distinct labels are few. That gap between "how many rows" and "how many distinct labels" is the theme of the next two sections.
Why not just number them randomly (NYC=1, Seattle=2, Portland=3)? Because the model would then believe Portland − NYC = 2 steps apart, an ordering you never intended. Encoding is only correct when the numbers mean something. That is what ordinal and target encoding each guarantee, in two different ways.
The three dots … mean "and so on in the same pattern". So {c1,c2,…,ck} = "the first category, the second, ..., up to the k-th".
The word cardinality just means "the value of k" — the number of distinct categories. "High-cardinality" (the parent's motivation for target encoding) simply means k is large, e.g. 500 cities. Keep that word — it decides which encoding you pick. See Curse of Dimensionality for why large k hurts.
Think of a function as a lookup dictionary: you hand it a word, it hands back a number. ford is the ordinal dictionary; ftarget is the target dictionary. The subscript on f just tells you which dictionary.
Figure s02. The mapping ford drawn as arrows. Each ordered word on the left (blue) points to one number on the right (yellow). Crucially the words are stacked in their real-world orderS, M, L, XL — so the arrows land on 1, 2, 3, 4 in the same order. If you shuffled the left column the arrows would still work as a dictionary, but the meaning (order) would be lost. That ordering choice is the subject of the next callout.
Read aloud: "the ordinal code of the i-th category is its position number i." So the smallest category gets 1, the next gets 2, and so on. That is the whole formula — the parent's fancy line is just this dictionary written compactly.
This is the single scariest-looking symbol in the parent note. Let us disarm it.
Figure s03. The filter in action on a city column. Every row is listed; the pink boxes are the ones surviving the test xi=NYC — rows 1, 2, 4. Only those pink rows' targets (500, 600, 550) get added and averaged. The greyed-out Seattle and Portland rows are simply invisible to this particular category's calculation. Change c to Seattle and a different set of rows lights up.
Why the topic needs it: target encoding must gather only the rows of one category to average their outcomes. This filter is how the maths says "look at just the NYC houses."
Now the mean falls out naturally. A mean (average) is "total divided by count":
The bar over y (read "y-bar") is standard shorthand for "the mean of". The little "∑i=1n" means "add y1 through yn, every row". The difference between the two formulas is which rows you include: yc filters to one category, yglobal takes them all.
Now we can finally fill in the second dictionary from §3 — the one we named but left blank.
The last symbols appear in smoothed target encoding. They are all built from means you now understand.
TEsmooth(c)=w⋅yc+(1−w)⋅yglobal
Figure s04. The slider. Blue pin = category mean (300 for lonely Portland); yellow pin = global mean (475). The pink dot is where a category with nc=1 lands — flung almost onto the global pin because we barely trust one observation. The blue square shows a category with nc=100 landing right next to its own mean. The dot's position is the weight w: near the yellow pin means w near 0, near the blue pin means w near 1.
Related vault stops once you are through here: One-hot Encoding (the wasteful alternative for high k), Feature Scaling (what to do with the numbers afterward), Cross-Validation (how to avoid target leakage), Tree-based Models and Overfitting (why smoothing matters).