Databricks Generative AI Engineer Associate exam dumps

Databricks Generative AI Engineer Associate practice question 186 of 306

Databricks Certified Generative AI Engineer Associate. Free level, Databricks. Free question with the correct answer and a full explanation.

Databricks Generative AI Engineer Associate Question 186

Select 3

You are tasked with deploying a machine learning model for sentiment analysis in Databricks. To improve the model's performance and usability, you decide to wrap it in a pyfunc model with custom pre- and post-processing logic. Which of the following steps are required to code and deploy this chain correctly?

  1. A

    Define a Python class inheriting from mlflow.pyfunc.PythonModel and implement load_context and predict methods.

  2. B

    Write the pre-processing logic inside the load_context method and the post-processing logic inside the predict method.

  3. C

    Package the model and additional dependencies using conda.yaml or requirements.txt.

  4. D

    Log the pyfunc model to MLflow using mlflow.pyfunc.log_model.

  5. E

    Directly deploy the pyfunc model without testing the pre- and post-processing logic.

Show answer and explanation

Correct answers: A, C, D

Explanation

To code and deploy a pyfunc model with pre- and post-processing, you must define a Python class inheriting from mlflow.pyfunc.PythonModel, implement the load_context and predict methods, package necessary dependencies, and log the model in MLflow. Testing the model is essential, but the deployment process does not involve skipping this step.

  • A. Correct.

    Correct: To create a pyfunc model, you must define a Python class inheriting from mlflow.pyfunc.PythonModel and implement the load_context and predict methods, which are key entry points.

  • B. Incorrect.

    Incorrect: The pre-processing logic should typically be included in the predict method itself, as load_context is primarily used for loading any required artifacts or resources.

  • C. Correct.

    Correct: Additional dependencies required by the pyfunc model should be specified in a conda.yaml or requirements.txt file to ensure a reproducible environment.

  • D. Correct.

    Correct: Once the model with pre- and post-processing logic is implemented, it must be logged to MLflow using mlflow.pyfunc.log_model for deployment.

  • E. Incorrect.

    Incorrect: Testing the pre- and post-processing logic is a critical step to ensure the correctness and reliability of the deployed model.

Timed practice exam

Take a Databricks Generative AI Engineer Associate practice test under exam conditions

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

Start timed exam