Deployment for Machine Learnings
ML deployment is making a trained model available to applications: saving the model artefact, wrapping it in an API with FastAPI, packaging it in a Docker container, and orchestrating repeatable training pipelines. It begins the Production ML stage and handles batch versus real-time prediction and keeping serving code consistent with training.
Stage: Production ML · Part of the Machine Learning roadmap · Last reviewed 19 November 2026
What to learn in Deployment
- Save and load a model with joblib or torch.save
- Expose a prediction endpoint using FastAPI with validated input
- Package the service in a Docker image with pinned dependencies
- Choose between batch scoring and real-time serving for a use case
- Describe a pipeline that runs data preparation, training and evaluation as steps
Deployment interview questions
What is training-serving skew?
Training-serving skew is a difference between how features are computed in training and in production, such as different code paths or data sources. The model then sees inputs unlike what it learned from and performs worse. Shared feature code and pipelines reduce it.
When is batch prediction better than real-time serving?
Batch prediction suits cases where results are not needed instantly, such as nightly scores for all customers. It is cheaper and simpler to run. Real-time serving is needed when each user request needs a prediction within milliseconds.
Where Deployment fits in the Machine Learning roadmap
Deployment belongs to the Production ML stage (intermediate level), which takes about 3 hours. From notebook to service.
Other units in this stage
Back to the full Machine Learning roadmap