LFC MLflow Model Registry 3 — Questions and Answers
Question 1: How can you retrieve the latest model version in the 'Production' stage using MlflowClient?
- client.get_latest_versions(name, stages=['Production']) (Correct answer)
- client.get_model_version(name, 'Production')
- client.fetch_production_model(name)
- mlflow.get_production_model(name)
Correct answer: client.get_latest_versions(name, stages=['Production'])
`client.get_latest_versions(name, stages=['Production'])` returns the most recent model version(s) currently in the Production stage.
Question 2: In Databricks Unity Catalog, which permission is required to register a new model in a schema?
- USE SCHEMA
- CREATE MODEL (Correct answer)
- REGISTER MODEL
- WRITE MODEL
Correct answer: CREATE MODEL
The `CREATE MODEL` privilege on the target schema is required to register a new model under that schema in Unity Catalog.
Question 3: What information is captured automatically when a model is logged and registered via an MLflow run?
- Only the model binary file
- Model artifacts, parameters, metrics, and the source run ID (Correct answer)
- Only parameters and metrics
- Only the model binary and its schema
Correct answer: Model artifacts, parameters, metrics, and the source run ID
MLflow automatically links the registered model version to its source run, capturing artifacts, parameters, metrics, tags, and the run ID for full lineage.
Question 4: Which MLflow UI section allows you to compare metrics across multiple versions of the same registered model?
- The Experiments tab
- The registered model's version list with linked run comparisons (Correct answer)
- The Artifacts panel
- The Data Sources tab
Correct answer: The registered model's version list with linked run comparisons
From the Model Registry UI, each version links back to its source run, and you can navigate to the Experiments page to compare runs side-by-side.
Question 5: What happens to model versions already in Production when you use `archive_existing_versions=True` during a stage transition?
- They are deleted permanently
- They are moved to the Archived stage automatically (Correct answer)
- They remain in Production alongside the new version
- They are moved to Staging
Correct answer: They are moved to the Archived stage automatically
Setting `archive_existing_versions=True` automatically moves all current Production versions to Archived when a new version is transitioned to Production.
Question 6: Which Python snippet correctly loads the 'champion' alias version of a Unity Catalog model?
- mlflow.pyfunc.load_model('models:/main.ml.fraud@champion') (Correct answer)
- mlflow.load_model('uc://main.ml.fraud:champion')
- mlflow.pyfunc.load_model('registry:/main.ml.fraud@champion')
- mlflow.load_registered_model('main.ml.fraud', alias='champion')
Correct answer: mlflow.pyfunc.load_model('models:/main.ml.fraud@champion')
`mlflow.pyfunc.load_model('models:/main.ml.fraud@champion')` uses the correct `models:/` scheme with the `@alias` suffix for Unity Catalog.
Question 7: What is the primary advantage of using the MLflow Model Registry over storing models only as run artifacts?
- Faster model inference latency
- Centralized lifecycle management with versioning, staging, and lineage tracking (Correct answer)
- Automatic model retraining when accuracy drops
- Built-in A/B testing framework
Correct answer: Centralized lifecycle management with versioning, staging, and lineage tracking
The Model Registry provides a centralized hub for managing model versions, tracking promotion through lifecycle stages, and maintaining lineage back to training runs.
How can you retrieve the latest model version in the 'Production' stage using MlflowClient?