Databricks Machine Learning Professional exam dumps

Databricks Machine Learning Professional practice question 147 of 280

Databricks Certified Machine Learning Professional. Professional level, Databricks. Free question with the correct answer and a full explanation.

Databricks Machine Learning Professional Question 147

Single answer

You are working on a machine learning project in Databricks and have registered a trained model named 'churn_model' in the Model Registry. You now want to load this registered model for batch inference in Python. Which of the following code snippets correctly loads the registered model?

  1. A

    from mlflow import load_model; model = load_model('models:/churn_model/latest')

  2. B

    from mlflow import load_model; model = load_model('models:/churn_model/1')

  3. C

    from mlflow.pyfunc import load_model; model = load_model('models:/churn_model/latest')

  4. D

    from mlflow.pyfunc import load_model; model = load_model('models:/churn_model/1')

Show answer and explanation

Correct answer: C

Explanation

In Databricks, to load a registered model for inference, you use the 'mlflow.pyfunc.load_model' function along with the Model Registry URI ('models:/<model_name>/<version_or_stage>'). Using 'latest' as the stage in the URI ensures the latest version of the model is loaded. The other answers either use incorrect modules or fail to refer to the latest version of the model.

  • A. Incorrect.

    Incorrect: The 'mlflow' package itself does not have a 'load_model' function. You must use the 'mlflow.pyfunc' module to load registered models.

  • B. Incorrect.

    Incorrect: The 'mlflow' package itself does not have a 'load_model' function. You must use the 'mlflow.pyfunc' module to load registered models.

  • C. Correct.

    Correct: The 'mlflow.pyfunc.load_model' function is the correct method to load registered models. The 'models:/churn_model/latest' URI specifies that the latest version of the registered model should be loaded.

  • D. Incorrect.

    Incorrect: While 'mlflow.pyfunc.load_model' is correct, specifying the model version as '1' directly (e.g., 'models:/churn_model/1') would load a specific version instead of the latest version. However, the question asks for batch inference using the latest version.

Timed practice exam

Take a Databricks Machine Learning Professional practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam