Advanced level · Module 4 of 6 · 24 guided hours
Deploying Machine Learning Models
Package models reproducibly and serve predictions through APIs or batch jobs that others can run and trust.
Learning objectives
- Save models and environments reproducibly
- Serve predictions through a validated web API
- Choose between batch and real-time deployment and package services with containers
Topics
- saving pipelines with joblib
- environment and dependency pinning
- FastAPI services
- input validation with Pydantic
- batch vs real-time prediction
- Docker basics
Lessons
-
Lesson 1 Saving Models Reproducibly
Save trained pipelines and record everything needed to load and trust them later.
joblibdependency pinningrandom seedsmodel metadata
-
Lesson 2 Serving Predictions with an API
Wrap a model in a web API with validated inputs, clear errors and a health check.
FastAPIPydantic schema422 validation errorshealth endpoint
-
Lesson 3 Batch and Real-Time Deployment
Choose between scheduled batch predictions and on-demand APIs based on how predictions are used.
batch scoringreal-time inferencelatencyscheduling
-
Lesson 4 Packaging with Containers
Package the service and its dependencies in a container so it runs the same way everywhere.
containerDockerfileimage sizeconfiguration through environment variables
Practical activity
Serve the price forecasting model as a FastAPI service with input validation and a health check, and also as a monthly batch job that writes a report.
Expected outcomes
- Deployable, reproducible ML services
- Sound deployment choices
Assessment
Practical: the service must run on the instructor's machine from the README and reject invalid input with clear errors.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.