LFC MLflow Model Registry 2 — Questions and Answers
Question 1: Which MLflow API method is used to transition a registered model version to the 'Production' stage?
- mlflow.promote_model()
- client.transition_model_version_stage() (Correct answer)
- mlflow.set_stage()
- client.update_model_version_stage()
Correct answer: client.transition_model_version_stage()
The MlflowClient method `transition_model_version_stage()` is used to move a model version between stages like Staging, Production, or Archived.
Question 2: In Unity Catalog-backed MLflow, model names follow which naming convention?
- model_name
- catalog.schema.model_name (Correct answer)
- workspace.model_name
- registry.catalog.model_name
Correct answer: catalog.schema.model_name
Unity Catalog uses a three-level namespace: catalog.schema.model_name, such as main.ml_models.my_classifier.
Question 3: What is the purpose of model aliases in the MLflow Model Registry?
- To rename a model permanently
- To assign a mutable named reference to a specific model version (Correct answer)
- To archive old model versions automatically
- To create a copy of the model in another registry
Correct answer: To assign a mutable named reference to a specific model version
Aliases provide a mutable, human-readable pointer (e.g., 'champion') to a specific version, making it easy to update which version serves a role without changing calling code.
Question 4: Which function registers a model that was logged during an MLflow run?
- mlflow.log_model()
- mlflow.register_model() (Correct answer)
- mlflow.save_model()
- mlflow.publish_model()
Correct answer: mlflow.register_model()
`mlflow.register_model(model_uri, name)` takes the run artifact URI and registers it under a given name in the Model Registry.
Question 5: When loading a model from the registry using a Unity Catalog alias, which URI format is correct?
- models:/catalog.schema.model@alias (Correct answer)
- models://catalog.schema.model/alias
- uc://catalog.schema.model@alias
- registry://catalog.schema.model@alias
Correct answer: models:/catalog.schema.model@alias
The correct URI format uses `models:/` followed by the three-level name and `@alias`, e.g., `models:/main.ml.my_model@champion`.
Question 6: What does setting `registered_model_name` in `mlflow.log_model()` accomplish?
- It only saves the model locally without registering it
- It logs and simultaneously registers the model in the registry in one step (Correct answer)
- It moves the model to the Production stage automatically
- It creates a new experiment for the model
Correct answer: It logs and simultaneously registers the model in the registry in one step
Passing `registered_model_name` to `mlflow.log_model()` both logs the model artifact and registers it in the Model Registry as a single operation.
Question 7: Which stage is NOT a valid built-in stage in the legacy (Workspace) MLflow Model Registry?
- Staging
- Production
- Archived
- Deprecated (Correct answer)
Correct answer: Deprecated
The legacy MLflow Model Registry has three built-in stages: Staging, Production, and Archived; 'Deprecated' is not a standard stage.
Which MLflow API method is used to transition a registered model version to the 'Production' stage?