Track ML models
Creating a full picture of a ML model using the Model Control Plane
What is a ZenML Model?
Before diving in, let's take some time to build an understanding of what we mean when we say Model
in ZenML terms. A Model
is simply an entity that groups pipelines, artifacts, metadata, and other crucial business data into a unified entity. Please note that one of the most common artifacts that is associated with a Model in ZenML is the so-called technical model, which is the actual model file/files that hold the weight and parameters of a machine learning training result. However, this is not the only artifact that is relevant; artifacts such as the training data and the predictions this model produces in production are also linked inside a ZenML Model. In this sense, a ZenML Model is a concept that more broadly encapsulates your ML product's business logic.
These models can be viewed within ZenML:
zenml model list
can be used to list all models.
Configuring a model in a pipeline
Once you configure a pipeline this way, all artifacts generated during pipeline runs are automatically linked to the specified model. This connecting of artifacts provides lineage tracking and transparency into what data and models are used during training, evaluation, and inference.
The above will establish a link between all artifacts that pass through this ZenML pipeline and this model. This includes the technical model which is what comes out of the svc_trainer
step. You will be able to see all associated artifacts and pipeline runs, all within one view.
Furthermore, this pipeline run and all other pipeline runs that are configured with this model configuration will be linked to this model as well.
You can see all versions of a model, and associated artifacts and run like this:
zenml model version list <MODEL_NAME>
can be used to list all versions of a particular model.
The following commands can be used to list the various pipeline runs associated with a model:
zenml model version runs <MODEL_NAME> <MODEL_VERSIONNAME>
The following commands can be used to list the various artifacts associated with a model:
zenml model version data_artifacts <MODEL_NAME> <MODEL_VERSIONNAME>
zenml model version model_artifacts <MODEL_NAME> <MODEL_VERSIONNAME>
zenml model version deployment_artifacts <MODEL_NAME> <MODEL_VERSIONNAME>
Fetching the model in a pipeline
Logging metadata to the Model
object
Model
objectOnce metadata has been logged to a model, we can retrieve it easily with the client:
Using the stages of a model
A model's versions can exist in various stages. These are meant to signify their lifecycle state:
staging
: This version is staged for production.production
: This version is running in a production setting.latest
: The latest version of the model.archived
: This is archived and no longer relevant. This stage occurs when a model moves out of any other stage.
Last updated