May we use cookies so Meta, Google, LinkedIn and ChatGPT see your visit and we learn which ads work? PrivacyMay we use cookies to see which pages help, and let Meta, Google, LinkedIn and ChatGPT see your visit, so we know which of our ads work? That way we spend less on ads that do not work. We do not sell your data, and the site works the same if you decline. You can change your answer at any time under Cookie settings at the foot of the page. Privacy policy
Loading...
AI Engineering · Features And Feature Stores
Free preview: the first 2 parts of this 25-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by card or PayPal
See the Generative AI and Agentic AI courseread the rest of this lesson in
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by card or PayPal
See the Generative AI and Agentic AI coursein Features And Feature Stores
This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime AccessFoundation lessons of this course are free, no payment needed. Try them now
Let me start with a small picture.
Imagine a library card cabinet. Every book has a card, and every card must go into a drawer. If the cabinet has one drawer for every book, each card has its own place. But a big library may have thousands of books and only a few dozen drawers.
So the librarian uses a rule. Maybe she files each card by the first letter of the title. Now many cards share a drawer. The rule is quick and the cabinet stays small. But two very different books can end up side by side. A reader who opens the drawer cannot tell them apart without looking closer.

Machine learning has the same problem with columns that hold names instead of amounts. A shop's product code is one. This shop has 4,646 of them. A model needs numbers, so each code must be turned into numbers somehow. You can give every code its own column. You can file codes into a fixed number of drawers. Or you can replace each code with one number learned from the past.
In this lesson I try all three on real data, and two more besides. I count how many codes share a drawer, how much memory each choice needs, and what happens to a code the model has never seen.
This lesson uses the same shop, the same customers and the same question as the rest of the chapter. If any of that is new, please read what a feature is first. It sets up the data and the task, and it built six simple features that I reuse here as the starting point.
Those six features were recency, frequency, money, return share, tenure and products. They are all amounts: days, counts and pounds. None of them says WHICH products a customer likes. This lesson asks whether adding that, a column of product names, helps the model, and which way of turning names into numbers works best.
Two earlier lessons matter here. The lesson on point-in-time joins showed what happens when a feature sees past the cutoff. One of the encodings in this lesson did exactly that, by accident, and I only found it after the results came in.
The data engineering lesson on leakage before the split already measured how target encoding leaks when it is done on all the rows at once. I do not repeat that lesson here. This lesson is about scale: thousands of values, names that share a drawer, and names that only appear after training.