Exam Certified Machine Learning Professional All QuestionsBrowse all questions from this 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?

    Correct Answer: A

    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
hugodscarvalhoOption: A

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

Joy999Option: A

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

GVR76Option: A

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

BokNinjaOption: B

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)