Databricks Machine Learning Associate Question 631
Select 3You are tasked with deploying a custom machine learning model to a Databricks model serving endpoint. The model is not supported natively by MLflow's built-in flavors. Which of the following steps should you take to ensure a successful deployment?
- A
Use MLflow to package the model into a custom Python model flavor.
- B
Register the model in the Databricks Model Registry and specify a custom predict method.
- C
Deploy the model directly without using the Databricks Model Registry, as custom models do not require registering.
- D
Write a custom serving script to handle inference requests at the endpoint.
- E
Configure the serving endpoint using a native MLflow flavor option, such as
mlflow.sklearn.
Show answer and explanation
Correct answers: A, B, D
Explanation
To deploy a custom model to a Databricks model endpoint, you must use MLflow's custom Python model flavor to define the model, register it in the Databricks Model Registry, and create a custom serving script to handle inference requests. These steps ensure that the model can be served and managed correctly despite not being supported natively by MLflow flavors.
- A. Correct.
Correct: MLflow allows you to define a custom Python model flavor, which includes the ability to define a
predictmethod for custom inference logic. - B. Correct.
Correct: Registering the model in the Databricks Model Registry is necessary to manage and deploy the model effectively, even for custom models.
- C. Incorrect.
Incorrect: While custom models require additional steps for deployment, they still need to be registered in the Databricks Model Registry for serving.
- D. Correct.
Correct: A custom serving script is often necessary for handling inference requests when working with non-standard models.
- E. Incorrect.
Incorrect: Native MLflow flavors, such as
mlflow.sklearn, are only applicable to models built using supported libraries and cannot be used for custom models.