Sub topic 2
Comparing runs and sharing results with a team
This chapter assumes you can log runs with MLflow or Weights & Biases, you know what a metric and a hyperparameter are, and you have a tracking server or hosted account available.
Comparing runs side by side
Both tools show runs in a table and a chart. You can filter by experiment, sort by validation AUC, and group by a parameter such as max_depth. Use the same metric name in every run, or the comparison view will split your results across separate columns.
Sharing works differently in each tool. MLflow relies on the tracking server URL, so every colleague needs network access to that server. Weights & Biases stores runs in a hosted workspace, and you add teammates to a project through its settings.
Artifacts, dataset versions, and model registries
An artifact is any file a run produces or reads, such as a model file, a dataset snapshot, or a plot. Log the dataset as an artifact so a reader can see which data trained a model.
import mlflow
mlflow.set_tracking_uri("http://127.0.0.1:5000")
mlflow.set_experiment("churn-model")
with mlflow.start_run(run_name="baseline"):
mlflow.log_artifact("train.csv") # a local file you created earlier
mlflow.set_tag("data_version", "2026-11-01")A model registry is a catalog of named model versions. MLflow Model Registry and the W&B Registry both provide one. Promote a version only after a reviewer approves it.
Framework integrations and autologging
Autologging records parameters, metrics, and models without explicit log calls. MLflow provides mlflow.sklearn.autolog(), and W&B provides callbacks for frameworks such as Keras and PyTorch Lightning. Autologging saves effort, but it can capture more than you want, so inspect a run before you rely on it.
import mlflow
import mlflow.sklearn
from sklearn.datasets import make_classification
from sklearn.linear_model import LogisticRegression
mlflow.sklearn.autolog()
X, y = make_classification(n_samples=500, random_state=0)
with mlflow.start_run():
LogisticRegression(max_iter=200).fit(X, y)Other options
| Tool | Typical fit |
|---|---|
| TensorBoard | Local training curves for TensorFlow or PyTorch, with little team sharing |
| Comet | Hosted tracking with run comparison and reports |
| ClearML | Open-source platform with tracking, pipelines, and self-hosting |
| Aim | Open-source tracker with a local web UI for comparing many runs |
Exercise
Your teammate can see the MLflow UI on your laptop but not on the team server. What is the most likely cause, and how do you check it?
Show answer
The server is bound to 127.0.0.1, so only your own machine can reach it. Start it with --host 0.0.0.0 or behind a reachable address, then confirm the URL works from the teammate's machine.