n have a look at the SDK docs.

How do you use it?To be able to log information from a ZenML pipeline step using the Comet Experiment Tracker component in the active stack, you need to enable an experiment tracker using the @step decorator. Then use Comet logging capabilities as you would normally do, e.g.:

from zenml.client import Client

experiment_tracker = Client().active_stack.experiment_tracker

@step(experiment_tracker=experiment_tracker.name)

def my_step():

...

experiment_tracker.log_metrics({"my_metric": 42})

experiment_tracker.log_params({"my_param": "hello"})

...

Instead of hardcoding an experiment tracker name, you can also use the Client to dynamically use the experiment tracker of your active stack, as shown in the example above.

Comet UI

Comet comes with a web-based UI that you can use to find further details about your tracked experiments.

Every ZenML step that uses Comet should create a separate experiment which you can inspect in the Comet UI.

You can find the URL of the Comet experiment linked to a specific ZenML run via the metadata of the step in which the experiment tracker was used:

from zenml.client import Client

last_run = client.get_pipeline("<PIPELINE_NAME>").last_run

trainer_step = last_run.get_step("<STEP_NAME>")

tracking_url = trainer_step.run_metadata["experiment_tracker_url"].value

print(tracking_url)

Alternatively, you can see an overview of all experiments at https://www.comet.com/{WORKSPACE_NAME}/{PROJECT_NAME}/experiments/.

The naming convention of each Comet experiment is {pipeline_run_name}_{step_name} (e.g., comet_example_pipeline-25_Apr_22-20_06_33_535737_my_step), and each experiment will be tagged with both pipeline_name and pipeline_run_name, which you can use to group and filter experiments.

Additional configuration

For additional configuration of the Comet experiment tracker, you can pass CometExperimentTrackerSettings to provide additional tags for your experiments: