Databricks Machine Learning Associate Question 122
Select 3You are working on a machine learning project in Databricks and have trained a model that you want to register in the MLflow Model Registry using the MLflow Client API. Which of the following steps are required to register the model?
- A
Instantiate an MLflow Client object to interact with the MLflow Tracking Server.
- B
Use the
create_registered_modelmethod from the MLflow Client to register the model. - C
Log the model to MLflow Tracking with an appropriate model signature and artifacts.
- D
Use the
create_model_versionmethod from the MLflow Client to associate the model with the registry. - E
Directly upload the model file to the Databricks File System (DBFS) to register it.
Show answer and explanation
Correct answers: A, C, D
Explanation
To register a model using the MLflow Client API, you must first instantiate an MLflow Client to interact with the MLflow Tracking Server. You then log the model to MLflow Tracking, which stores the model artifacts and metadata in a run. Finally, you use the create_model_version method to associate the logged model with the MLflow Model Registry, effectively registering it as a new version.
- A. Correct.
Correct: Instantiating an MLflow Client object is required to interact with the MLflow Tracking Server and perform operations like logging and registering models.
- B. Incorrect.
Incorrect: The
create_registered_modelmethod is used for creating a registered model name but is not necessarily required to register a specific model version. This step is optional if the model registry name already exists. - C. Correct.
Correct: Logging the model to MLflow Tracking is essential because it generates a run and stores metadata (e.g., parameters, metrics, and artifacts) that can later be referenced during registration.
- D. Correct.
Correct: The
create_model_versionmethod is required to create a new version of the model in the MLflow Model Registry and link it to the logged model artifact. - E. Incorrect.
Incorrect: Uploading the model directly to DBFS does not register the model with the MLflow Model Registry. MLflow requires specific API calls to perform registration.