Databricks Machine Learning Professional exam dumps

Databricks Machine Learning Professional practice question 36 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 36

Select 3

You are building a machine learning model in Databricks and want to ensure that the model's input schema is clearly defined and that it can be easily validated during deployment. You decide to log a model using MLflow with a model signature and input example. Which of the following steps are required to correctly log the model with these features?

  1. A

    Generate a sample input DataFrame and pass it to the input_example parameter when calling mlflow.log_model().

  2. B

    Use the infer_signature() function to automatically infer the model signature from a sample input and output.

  3. C

    Log the model signature and input example as separate artifacts in MLflow using mlflow.log_artifact().

  4. D

    Ensure the input_example matches the schema defined in the model signature.

  5. E

    Skip defining an input example if the model signature is already defined.

Show answer and explanation

Correct answers: A, B, D

Explanation

To log a model with MLflow that includes a model signature and input example, you must define both correctly. The model signature provides the schema for the model's inputs and outputs, while the input example demonstrates a valid input instance. These features ensure that the model can be validated and used seamlessly during deployment. The infer_signature() function simplifies the process of defining the signature, and the input_example must align with the signature for consistency. Logging these directly with mlflow.log_model() is the correct approach.

  • A. Correct.

    Correct: Generating a sample input DataFrame and passing it to the input_example parameter is necessary to log an input example for the model in MLflow. This helps in validating inputs during deployment.

  • B. Correct.

    Correct: Using the infer_signature() function is the recommended way to define the model signature, as it infers the schema of the inputs and outputs automatically from sample data.

  • C. Incorrect.

    Incorrect: While artifacts can be logged using mlflow.log_artifact(), the model signature and input example should be logged directly with the model using mlflow.log_model().

  • D. Correct.

    Correct: The input_example must match the schema defined in the model signature to ensure consistency and prevent validation errors during deployment.

  • E. Incorrect.

    Incorrect: Skipping the input example is not recommended, even if the model signature is defined, as the input example provides additional information for validating inputs during deployment.

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