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 · Packaging And Registry
Free preview: the first 2 parts of this 29-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 Packaging And Registry
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 box of index cards, like the one in the picture.
Imagine an office that keeps one card for every customer in a long box. The box has dividers with letters on them: A, B, C and so on. Every card goes behind the divider for the first letter of the customer's name. When someone needs a customer, they go to the right divider and pull the card.

Now one card goes behind the wrong divider. The card is fine. The name on it is right and so is the phone number. The box still closes. Nothing beeps. The mistake shows up much later, when someone looks for that customer and finds the wrong person, or no one.
A trained model reads its inputs the same way. It does not read the name of each number. It reads the slot the number sits in. In this lesson I put the right numbers into the wrong slots, on purpose, and in other wrong shapes too. Then I measure two things: what the model does, and which checks notice.
This lesson uses the model from the features chapter. If it is new to you, please read what a feature is first.
That lesson built six features for each customer of a real online shop. They are recency in days, frequency, money, the share of returned lines, tenure in days, and the number of different products. It asked one question: at the start of a month, will this customer buy something in the next 30 days? The model is a gradient boosted tree model from scikit-learn, and it scored a test AP of 0.5450. AP, average precision, is a score from 0 to 1 for how well the model ranks the buyers above the others.
The last lesson, a model registry, hands on, ended with a warning. I pointed the registry's champion alias at a model that takes other columns. The serving code kept sending the six columns. Nothing raised an error, and the test AP fell to 0.1731. The model's signature only said "six float64 numbers", and the wrong columns were six float64 numbers too.
This lesson takes that one finding and goes deep on it. I do not repeat the registry walkthrough. The features chapter's lesson on online and offline consistency showed that two correct pieces of code can compute a feature a little differently. Here the values are exactly right, and only their shape is wrong.