Databricks Certified Machine Learning Professional — Question 1

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?

Answer options

Correct answer: A

Explanation

The correct answer is A because it accurately uses the model_uri to register the model with the specified name 'best_model'. Option B incorrectly uses run_id instead of model_uri, while C and E attempt to use incorrect formats or names for the model. Option D registers the model under the original name 'model', not 'best_model', which is not the desired outcome.