Attach metadata to an artifact
Learn how to log metadata for artifacts and models in ZenML.
Last updated
Learn how to log metadata for artifacts and models in ZenML.
Last updated
Metadata plays a critical role in ZenML, providing context and additional information about various entities within the platform. Anything which is metadata
in ZenML can be compared in the dashboard.
This guide will explain how to log metadata for artifacts and models in ZenML and detail the types of metadata that can be logged.
Artifacts in ZenML are outputs of steps within a pipeline, such as datasets, models, or evaluation results. Associating metadata with artifacts can help users understand the nature and characteristics of these outputs.
To log metadata for an artifact, you can use the log_artifact_metadata
method. This method allows you to attach a dictionary of key-value pairs as metadata to an artifact. The metadata can be any JSON-serializable value, including custom classes such as Uri
, Path
, DType
, and StorageSize
. Find out more about these different types here.
Here's an example of logging metadata for an artifact:
Once metadata has been logged in an artifact, or step, we can easily fetch the metadata with the ZenML Client:
When logging metadata passing a dictionary of dictionaries in the metadata
parameter will group the metadata into cards in the ZenML dashboard. This feature helps organize metadata into logical sections, making it easier to visualize and understand.
Here's an example of grouping metadata into cards:
In the ZenML dashboard, "model_metrics" and "data_details" would appear as separate cards, each containing their respective key-value pairs.