MLflow
How to log and visualize experiments with MLflow
When would you want to use it?
You should use the MLflow Experiment Tracker:
if you have already been using MLflow to track experiment results for your project and would like to continue doing so as you are incorporating MLOps workflows and best practices in your project through ZenML.
if you are looking for a more visually interactive way of navigating the results produced from your ZenML pipeline runs (e.g. models, metrics, datasets)
if you or your team already have a shared MLflow Tracking service deployed somewhere on-premise or in the cloud, and you would like to connect ZenML to it to share the artifacts and metrics logged by your pipelines
How do you deploy it?
The MLflow Experiment Tracker flavor is provided by the MLflow ZenML integration, you need to install it on your local machine to be able to register an MLflow Experiment Tracker and add it to your stack:
Authentication Methods
You need to configure the following credentials for authentication to a remote MLflow tracking server:
tracking_uri
: The URL pointing to the MLflow tracking server. If using an MLflow Tracking Server managed by Databricks, then the value of this attribute should be"databricks"
.tracking_username
: Username for authenticating with the MLflow tracking server.tracking_password
: Password for authenticating with the MLflow tracking server.tracking_token
(in place oftracking_username
andtracking_password
): Token for authenticating with the MLflow tracking server.tracking_insecure_tls
(optional): Set to skip verifying the MLflow tracking server SSL certificate.
Either tracking_token
or tracking_username
and tracking_password
must be specified.
This option configures the credentials for the MLflow tracking service directly as stack component attributes.
This is not recommended for production settings as the credentials won't be stored securely and will be clearly visible in the stack configuration.
How do you use it?
To be able to log information from a ZenML pipeline step using the MLflow Experiment Tracker component in the active stack, you need to enable an experiment tracker using the @step
decorator. Then use MLflow's logging or auto-logging capabilities as you would normally do, e.g.:
Additional configuration
For additional configuration of the MLflow experiment tracker, you can pass MLFlowExperimentTrackerSettings
to create nested runs or add additional tags to your MLflow runs:
You can also check out our examples pages for working examples that use the MLflow Experiment Tracker in their stacks:
Last updated