MLflow is an open-source platform for managing the complete machine learning lifecycle, including experiment tracking, reproducible runs, and model packaging. It provides unified APIs for logging parameters, metrics, and artifacts across frameworks, a Model Registry for versioning and promoting models through stages, and flexible deployment options from local serving to cloud platforms. A key insight: MLflow's autologging can capture most training metadata automatically, but custom logging gives you fine-grained control over exactly what gets tracked—and understanding both approaches ensures you capture the right information without clutter.
What This Cheat Sheet Covers
This topic spans 20 focused tables and 142 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Run Management and Context
| Function | Example | Description |
|---|---|---|
with mlflow.start_run(): mlflow.log_param("alpha", 0.5) | Context manager that creates a new run or resumes an existing run; returns run object with run_id and experiment_id; supports nesting for parent-child relationships. | |
run = mlflow.active_run()run_id = run.info.run_id | Returns the currently active run object or None; useful for retrieving run_id inside a context without explicit assignment. | |
mlflow.end_run() | Explicitly ends the currently active run; automatically called when exiting start_run context manager; useful for manual run termination. |