Databricks Machine Learning Associate · Section 1 · 38% of the exam
Register a model using the MLflow Client API in the Unity Catalog registry
One of the objectives of the Databricks Certified Machine Learning Associate exam, in the section “Databricks Machine Learning”. Here is what it covers, the points to remember and a question to try.
What it covers
Models in Unity Catalog is the MLflow model registry governed by Unity Catalog. This lesson covers why it replaces the workspace registry, how to register versions with the fluent and Client APIs, how to set and remove tags, and how champion and challenger aliases drive promotion.
Points to remember
- Unity Catalog models use
catalog.schema.modelnames; the MLflow 3 default registry URI on Databricks isdatabricks-uc. - Benefits over the workspace registry: centralized Unity Catalog access control, audit logs, lineage to tables and feature tables, discovery and access from every workspace on the metastore.
- The workspace registry is legacy (disabled for new accounts since April 2024); its stages, transition requests and webhooks are not in Unity Catalog.
- New Unity Catalog model versions must have a signature (
signature=orinput_example=). - Register:
log_model(registered_model_name=...),mlflow.register_model(uri, name), orMlflowClientcreate_registered_model+create_model_version(name, source, run_id).
Try a question
Using only the MLflow Client API, an ML engineer must register a logged model as the first version of the Unity Catalog model name = "prod.ml.churn_model", which does not exist yet. Which sequence does this?
- A
client.create_registered_model(name), thenclient.create_model_version(name=name, source=model_uri, run_id=run_id) - B
client.create_model_version(name="churn_model", source=model_uri)followed byclient.set_registered_model_alias("churn_model", "champion", 1) - C
client.transition_model_version_stage("prod.ml.churn_model", 1, "Production")after logging the model - D
client.set_registered_model_tag("prod.ml.churn_model", "source", model_uri), which registers the model the tag points to
Show the answer
A. With MlflowClient, create_registered_model(name) creates the model (and raises if it already exists), and create_model_version(name, source, run_id) registers a model artifact as a new version. The fluent mlflow.register_model does both in one call.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Models in Unity Catalog: register, tag and alias teaches this objective (about 40 minutes), and 19 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Identify the best practices of an MLOps strategy
- Identify the advantages of using ML runtimes
- Identify how AutoML facilitates model/feature selection.
- Identify the advantages AutoML brings to the model development process
- Identify the benefits of creating feature store tables at the account level in Unity Catalog in Databricks vs at the workspace level
- Create a feature store table in Unity Catalog
- Write data to a feature store table
- Train a model with features from a feature store table.
- Score a model using features from a feature store table.
- Describe the differences between online and offline feature tables
- Identify the best run using the MLflow Client API.
- Manually log metrics, artifacts, and models in an MLflow Run.