CertLumen

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.model names; the MLflow 3 default registry URI on Databricks is databricks-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= or input_example=).
  • Register: log_model(registered_model_name=...), mlflow.register_model(uri, name), or MlflowClient create_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?

  1. Aclient.create_registered_model(name), then client.create_model_version(name=name, source=model_uri, run_id=run_id)
  2. Bclient.create_model_version(name="churn_model", source=model_uri) followed by client.set_registered_model_alias("churn_model", "champion", 1)
  3. Cclient.transition_model_version_stage("prod.ml.churn_model", 1, "Production") after logging the model
  4. Dclient.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

← Previous objective · All 48 objectives · Next objective →