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 26-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 you want to know how busy a small café is. You could count the customers who came in during the last hour. You could count the last week. Or you could count the whole year. Each count is true. Each one answers a slightly different question.
The last hour tells you about right now, but it is often zero, and zero tells you very little. The whole year almost never says zero, but it mixes this week with last winter. Somewhere in between there is a count that is most useful for the question you actually have.

Machine learning teams face this choice every day. They write a feature like "purchases in the last 7 days" and then someone asks: why 7? Why not 30, or 90, or a year? Usually the answer is a guess, or a habit from the last project.
In this lesson I stop guessing. I measure six different lengths of ruler on real data from a real shop. Then I measure what happens when the model gets all of them at once.
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.
The six features from that lesson were recency, frequency, money, return share, tenure and products. Three of them, frequency, money and products, count over the customer's whole history before the cutoff. They have no window at all. They look back as far as the data goes.
The lesson on point-in-time joins showed what happens when a feature sees past the cutoff by mistake. Every window in this lesson ends strictly before the cutoff, and the code checks that, so that leak cannot happen here.
So the question is new. Lesson 1 asked whether features are worth more than a better model. This lesson asks a narrower question that comes right after. Once you decide to count things, over what stretch of time should you count them? And does it help to count over several stretches at once?