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 30-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 notebook, like the one in the picture.
Imagine a cook who keeps one notebook for a single dish. Every time she changes the recipe, she does not rub out the old page. She writes the new recipe on a fresh page, with a number, the date, what she changed and how the guests liked it. Then she puts a bookmark in the page the kitchen should cook today.

The kitchen never asks "which page number?". It asks "where is the bookmark?". If the new recipe goes badly, she moves the bookmark back one page. No page is rewritten, and nobody in the kitchen has to learn anything new. They just open the notebook at the bookmark again.
A works in the same way for trained models. In this lesson I run a real one on my laptop and write three versions of a model into it. Then I move the bookmark back and forth, and measure what really happens on disk each time. I also try to break it, and I show the real error messages.
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, from the customer's past invoices. 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.
Earlier lessons of this chapter matter here. Saving formats compared showed that skops refuses some tree types until you name them. Skops is a safe format for scikit-learn models. Pinning dependencies showed why the exact library versions must be written down.
The survey lesson on model registry and versioning explains a registry in words: versions, stages and promotion. The lifecycle chapter measured the promotion gate and lineage and rollback. I do not repeat them. Here I run a real registry and look inside it.