Databricks Machine Learning Professional Question 104
Single answerYou are a machine learning engineer working with Databricks, and your team has implemented a CI/CD pipeline for managing MLflow models. You want to automate the retraining of your model whenever it transitions from the 'Staging' stage to the 'Production' stage in MLflow. How can you achieve this in Databricks?
- A
Create a Databricks Job with a webhook trigger, configure the webhook to listen for 'model_version_stage_transition' events in MLflow, and write logic to retrain the model.
- B
Configure an MLflow Model Registry lifecycle event to automatically retrain the model when a stage transition occurs.
- C
Create a Databricks Job with a time-based schedule and include logic to check for model stage transitions in MLflow.
- D
Use Databricks AutoML to detect stage transitions and automatically retrain the model.
Show answer and explanation
Correct answer: A
Explanation
To automate tasks in Databricks when a model transitions between stages, a Databricks Job triggered by an MLflow webhook is the appropriate solution. MLflow provides a 'model_version_stage_transition' event that can be used to trigger such Jobs, enabling you to implement custom logic such as retraining the model.
- A. Correct.
This is the correct solution. Databricks Jobs can be triggered using webhooks, and MLflow provides a 'model_version_stage_transition' event that can be used to trigger actions like retraining models.
- B. Incorrect.
MLflow Model Registry does not have built-in support for automatically executing custom logic (like retraining) during stage transitions. You need to use a Databricks Job for this purpose.
- C. Incorrect.
A time-based schedule would not directly respond to stage transitions, making it less efficient and not aligned with the requirements of the scenario.
- D. Incorrect.
Databricks AutoML cannot detect MLflow model stage transitions or automate retraining based on these transitions. It is used for initial model development instead.