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...
This idea carries a full system design question on its own. Each walks through the full answer.
AI Engineering · Packaging And Registry
Free preview: the first 2 parts of this 27-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 baking, because everyone has done some version of it.
Imagine I bake a cake that my friends love. I write down what I used on a small list: flour, sugar, butter, eggs. Six months later I want the same cake, so I give the list to someone and send them to the shop. They come back with flour, sugar, butter and eggs. But the shop now sells a new flour under the same name, and the butter has a new recipe. The list was followed exactly, and the cake is still different. Sometimes it is a little different. Sometimes the oven setting I wrote down no longer works at all.

Now imagine a better card. It names the exact pack of flour, the exact butter, and for each pack it also gives a short code printed on the seal. Whoever goes to the shop must check the code. If the shop hands over a pack with a different code, they do not take it.
That card is what this lesson builds for a machine learning model. The short list is the usual requirements.txt. The card is a lock file.
This lesson is the cure for the problem in the last one. Library version skew saved the chapter's model with one version of scikit-learn and loaded it with another. Of 30 loads across different setups, 22 failed. I will not repeat how those loads broke. Here I only use lesson 3's stored results. And I ask the question that comes before it. How does a team end up with a different scikit-learn, when nobody chose to upgrade?
The model is still the one from the features chapter, built in what a feature is. It is a gradient boosted tree model from scikit-learn. It predicts whether a customer of an online shop buys again in the next 30 days. Its test score, called AP, was 0.5450. My lab trained it again in its main environment and got 0.5450 again. Everything below uses the same data, features and settings, though the library versions change, which is the point of the lesson.
The lifecycle chapter's lineage and rollback lesson said it did not measure library versions. Lesson 3 measured what versions do to a saved model. This lesson measures where the versions come from.