Which run produced that model? What data and params made it? Without tracking, nobody knows. MLflow records every run so your work is reproducible — start here.
Why: without tracking, ML work is a graveyard of notebooks and files named model_final_v3 — you cannot say which code, data, and parameters produced a given model, so you cannot reproduce or trust it. When: adopt tracking on day one of any project. Where: MLflow records each run’s parameters, metrics, and artifacts in one place you can query and compare.
WITHOUT TRACKING WITH MLFLOW
model_final_v3.pkl every run logged: params, metrics,
"which params was that?" artifacts, code version, data version
results in a spreadsheet compare runs side by side
can't reproduce last month reproduce any run from its record
Rule: if a result isn't logged, it didn't happen.Why: MLflow installs as a Python package and, for a real project, logs to a tracking server with a database backend and artifact store rather than the local filesystem — so results are shared and durable. When: use the local file store to learn; point at a server for team work. Where: MLFLOW_TRACKING_URI selects where runs are recorded.
pip install mlflow
# Learn locally (writes to ./mlruns), or point at a tracking server:
export MLFLOW_TRACKING_URI="http://mlflow.internal:5000"
# Launch the UI to browse runs:
mlflow ui # then open http://localhost:5000Why: a "run" is one execution of your training code, and inside it you log the inputs (parameters), the outputs (metrics), and the model itself — turning an ephemeral script into a permanent, comparable record. When: wrap every training run in start_run and log as you go. Where: runs are grouped into experiments, so set one per project or task.
import mlflow
mlflow.set_experiment("churn-model") # groups related runs
with mlflow.start_run():
mlflow.log_param("max_depth", 6) # an input
mlflow.log_param("n_estimators", 200)
# ... train the model ...
mlflow.log_metric("accuracy", 0.91) # an output
mlflow.log_metric("f1", 0.88)
print("logged run:", mlflow.active_run().info.run_id)