1. What is Model Registry?
A Model Registry is a centralized system used to store, manage, version, and track machine learning models. Instead of keeping trained models as random files:- Model name
- Model version
- Model artifacts
- Training metrics
- Model parameters
- Creation time
- Model stage/status
- Metadata
2. Why Model Versioning?
Model versioning makes it possible to keep multiple versions of a trained model. Example:3. Semantic Versioning
Semantic Versioning, commonly called SemVer, uses:MAJOR
Used when there are incompatible changes.- Completely different model architecture
- Input format changed
- Prediction interface changed
MINOR
Used when new functionality is added without breaking compatibility.- Additional features
- Improved model
- New preprocessing capability
PATCH
Used for small fixes.- Bug fix
- Configuration correction
- Minor improvement
4. Model Registry Workflow
5. MLflow Model Registry
For the MLflow-based workflow, MLflow Model Registry can be used to manage model versions. The basic architecture is:6. Install MLflow
7. Simple Model Registry Example
model_registry.py
8. Important Part: Registering the Model
This section registers the trained model:9. Start MLflow UI
Run:10. Load a Specific Model Version
A registered model can be loaded using its name and version.11. Make Predictions Using the Loaded Model
12. Load Different Versions
Version 1:13. Model Version Example
Suppose three training runs are performed.14. Model Lifecycle
A model can move through different lifecycle states depending on the registry workflow. Typical workflow:15. Model Registry vs Experiment Tracking
These concepts are related but different.Experiment Tracking
Answers:How was this model trained?Example:
Model Registry
Answers:Which model version should be used?Example:
16. Recommended Model Naming
Use descriptive names:17. Important Model Metadata
A production model registry should ideally track:18. Complete Model Lifecycle
Key Concepts
- Model Registry - centralized management of trained model versions.
- Model Version - a specific registered instance of a model.
- Semantic Versioning -
MAJOR.MINOR.PATCHversion format. - Experiment Tracking - records parameters, metrics, artifacts, and training runs.
- Model Registry - manages model versions and lifecycle.
- Model Artifact - saved trained model that can be loaded later.
- Rollback - switching back to an earlier model version.
- Staging - model validation environment before production.
- Production - model version currently used by an application.
- Archived - old model version retained for historical purposes.