A model registry is a central place to manage trained models after experimentation and before deployment. An experiment run may produce a model alongside metrics, hyperparameters, code, metadata, and other artifacts. Keeping the selected model connected to that run makes it easier to reproduce results, inspect lineage, collaborate, and load the model for inference. section 1.3.3 section 4.0 section 9.3.5
MLflow combines experiment tracking with a model registry. Logging every run is not the same as registering every model: first compare candidates against evaluation criteria, then register a promising run under a model name. The registered model has versions and can carry aliases and other metadata. section 4.1.3 section 9.3.5
A practical path from experiment to deployment is:
- Log candidate models and evaluation metrics in MLflow. Query the runs to find models that meet a threshold, then rank those candidates by the metric that matters. section 4.1.3
- Register the selected run’s model URI with a name. Use the registered model to retrieve the model for inference or to reproduce the experiment. section 4.1.3
- Promote qualifying models through staging and production. Use versions and aliases to identify what is active, retain lineage for auditing, and make rollback possible. Keep a manual promotion checkpoint when automation alone is insufficient. section 9.3.5
Register a classifier selected by test AUC
Suppose decision tree, random forest, and XGBoost runs have been evaluated. In MLflow, filter runs with `metrics.roc_auc_score_test > 0.8` and order by test AUC descending. Retrieve the leading run’s model URI and call `mlflow.register_model(model_uri, "random-forest-classifier")`. The same selection can begin in the MLflow UI; the client makes the query and registration programmatic. section 4.1.3
Listing 4.7 Retrieving MLflow runs and registering the model
from mlflow import MlflowClient
mlflow_client = MlflowClient()
experiment_name = "income-classifier"
experiment = mlflow_client.get_experiment_by_name(experiment_name)
run_object = mlflow_client.search_runs(
experiment_ids=experiment.experiment_id,
filter_string="metrics.roc_auc_score_test > 0.8",
max_results=1,
order_by=["metrics.roc_auc_score_test DESC"]
)[0] #1
model_uri = f"runs:/{run_object.info.run_id}/{experiment_name}" #2
mlflow.register_model(
model_uri,
"random-forest-classifier"
) #3
The listing shows the MLflow client calls that find the highest-ranked qualifying run, construct its model URI, and register it. section 4.1.3
The registry fits between model evaluation and serving; it does not replace either. A deployment can load a registered model, while a separate feature store supplies the features needed for training and predictions. Keeping model download straightforward also supports manual inspection when metrics do not fully explain model behavior. section 4.0 section 9.4

