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 24-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 shop.
Imagine a small shop with a wall of drawers behind the counter. Each regular customer has a card in a drawer. The card says how often they come, how much they usually spend, and when they last came in. The shop owner uses the cards to decide whom to phone about a new delivery.
Nobody updates the cards after every visit. That would take all day. Instead, every Sunday evening someone sits down with the week's receipts and writes up all the cards at once.

So on a Thursday, the card she reads is four days old. A customer who came in on Tuesday and spent a lot is not on it yet. Does that matter? Would she phone the wrong people? Or are the cards still good enough, because people's habits change slowly?
This lesson asks exactly that. Machine learning systems have the same cards and the same Sunday evening. In this lesson I measure what the delay costs, on real data from a real shop.
This is the third lesson of the chapter on features and feature stores. It uses the same shop data and the same prediction task as the first two.
The first lesson, what a feature is, built six made features from each customer's history: recency, frequency, money, return share, tenure and products. With those six, a default model reached a test average precision of 0.5450. I use exactly that model and exactly those features here. Lag 0 in this lesson is that model, checked to the last digit.
The second lesson, point-in-time joins, was about the opposite mistake. There, training rows read values from AFTER their cutoff, which made the offline score look far too good. Here, the live system reads values from well BEFORE its cutoff. Nothing leaks. The values are honest, only old.
The question is simple. In production, features are usually computed by a job on a schedule. At prediction time they may be hours or days old. How old can they get before the model gets worse?