MLflow Experiment Tracking
Without experiment tracking, ML research is folklore. MLflow turns every training run into a reproducible, comparable, promotable artifact.
Without experiment tracking, ML research is folklore. MLflow turns every training run into a reproducible, comparable, promotable artifact.
Reproducibility starts with tracking every run, every parameter, every result.
Without experiment tracking, ML research quickly becomes folklore: “I think I got 87% accuracy with learning rate 0.001 and dropout 0.3 — or was it 0.5?” Model development collapses into a long trail of notebooks with names like model_final_v3_ACTUAL_FINAL.ipynb, with no reliable way to recover the exact conditions that produced the best result.
Experiment tracking solves this by logging every training run with its complete context: hyperparameters, dataset version, code version, environment, metrics, and output artifacts. Any run can be replicated exactly. Any two runs can be compared on equal footing.
MLflow is an open-source platform built around four core components:
mlflow run.Every logged item in MLflow belongs to a hierarchy:
For popular frameworks (scikit-learn, XGBoost, PyTorch Lightning, TensorFlow), MLflow autolog captures common parameters and metrics automatically with a single call:
mlflow.sklearn.autolog()
with mlflow.start_run():
model.fit(X_train, y_train)
This logs estimator parameters, feature importances, the fitted model itself, train/test metrics, and a confusion matrix — all without any explicit log calls.
The Model Registry separates the training concern (which run produced the best model?) from the deployment concern (which model version is in production?). The typical workflow:
mlflow.register_model(run_uri, “FraudDetector”).This creates a complete audit trail: every model in production is traceable to the exact training run, dataset, code commit, and environment that produced it.
MLflow's comparison UI plots metrics across runs. For programmatic comparison, the MLflow client API provides a search interface:
runs = mlflow.search_runs(
filter_string=“metrics.val_accuracy > 0.85”,
order_by=[“metrics.val_loss ASC”]
)
This returns a pandas DataFrame of all matching runs with their parameters and metrics, enabling automated model selection pipelines.
| Tool | Strengths | Considerations |
|---|---|---|
| MLflow | Open source, self-hostable, broad framework support | UI less polished than cloud tools |
| Weights & Biases | Excellent visualisation, team collaboration | SaaS pricing, data leaves your infra |
| Neptune.ai | Strong metadata management | Smaller ecosystem |
| Comet ML | Strong NLP/CV integrations | SaaS-first |
Say the answer out loud before you reveal it.
What are the four core components of MLflow?
What is the difference between a parameter and a metric in MLflow?
What does the MLflow Model Registry do?
What does mlflow autolog capture automatically?
MLflow tracks parameters (immutable config), metrics (time-series numbers), and artifacts (files) per run. Model Registry manages Staging → Production lifecycle. Every production model is traceable to exact training run + dataset + code commit.