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 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 at an airport.
You hand your suitcase to the airline. Many hours later, at the other end, a suitcase comes out on the belt. It looks like yours. How do you know it is yours, and that nobody opened it on the way?

The officer in the picture runs every bag through a scanner. The scanner looks for dangerous shapes, like a knife. It is useful, but it cannot tell you whether a bag is yours. Two bags with the same clothes look the same to it.
So you use other checks. The tag has a number that must match your ticket. You can open the bag and look for a few things you know you packed. And if you had put a seal on the zip that only you can make, a broken or different seal tells you someone else was there.
A trained model is a file that travels too. It goes from the training machine to a registry, then into a container, then onto a server. In this lesson I change copies of a real model file in five ways, and I measure which check notices which change.
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. The question is: 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.
This is the last lesson of the chapter, and it uses four earlier ones. What is in a model file showed that a pickle file is mostly the raw bytes of number arrays, and that loading it runs code. Pinning dependencies used hashes to lock the libraries. Reproducible artifacts found that the thread count changes one byte of the file. And a model registry, hands on showed that a registry stores whatever tags you give it.
Here I bring them together around one question: how do you know the file you load is the file you trained?