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 25-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 set of wooden nesting dolls.
Say I want to send them to a friend in another city. I can put them in a loose box with a lot of air around them. I can squeeze the air out, so the parcel is small, but my friend has to unpack it more carefully. Or I can use a sealed box with a printed list of everything inside. My friend must read the list and sign it before the box will open.

Three things matter. How big is the parcel? Do the dolls arrive exactly as they left, with nothing chipped or swapped? And what does my friend have to trust before opening it?
A trained model has exactly these three questions when you save it to a file. In this lesson I save one real model in eleven different ways and measure all three. I do not guess, and I do not repeat what tool websites say without checking it.
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: recency, frequency, money, return share, tenure and products. The question is always the same: 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. Every lab in this chapter starts by training that model again and checking that it scores 0.5450 exactly.
Two other lessons sit close to this one. Model packaging and containerization gives the big picture: why a model file alone is not enough to ship. I do not repeat it. The first lesson of this chapter opens a pickle file and shows that loading one can run code. Here I only use that fact. I do not prove it again.
This lesson asks one narrower question. Which format should you save a model in, and what does each one cost you?