Certified Machine Learning Professional Exam QuestionsBrowse all questions from this exam

Certified Machine Learning Professional Exam - Question 46


A machine learning engineer is migrating a machine learning pipeline to use Databricks Machine Learning. They have programmatically identified the best run from an MLflow Experiment and stored its URI in the model_uri variable and its Run ID in the run_id variable. They have also determined that the model was logged with the name "model". Now, the machine learning engineer wants to register that model in the MLflow Model Registry with the name "best_model".

Which of the following lines of code can they use to register the model to the MLflow Model Registry?

Show Answer
Correct Answer: AD

To register a model in the MLflow Model Registry, you need to use the `model_uri` and the desired name for the registered model. The correct way to register the model is by calling `mlflow.register_model` with the `model_uri` and the name 'best_model'.

Discussion

4 comments
Sign in to comment
hugodscarvalhoOption: A
Jan 27, 2024

According to MLflow documentation, we need the model_uri and a model name to register it. The run_id is not necessary for registering the model itself; it might be useful for other operations, such as retrieving additional information about the run from which the model was produced. Doc: https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.register_model

BokNinjaOption: B
Dec 19, 2023

Answer is B import mlflow # Register the model model_details = mlflow.register_model( model_uri=model_uri, name="best_model" ) print("Registered model:", model_details)

GVR76Option: A
Jan 4, 2024

Based on the answer given below, right answer would be A

Joy999Option: A
Jun 28, 2024

To register a model using the API, use mlflow.register_model("runs:/{run_id}/{model-path}", "{registered-model-name}").