Databricks Machine Learning Professional Question 124
Select 3A data scientist has trained a machine learning model in Databricks and now needs to deploy it to process large volumes of data in a batch mode. The model will be used to score predictions on historical data stored in a Delta table. Which of the following steps are necessary to deploy the model for batch inference in Databricks?
- A
Save the trained model using MLflow and register it in the model registry.
- B
Write a PySpark job that loads the model and applies it to the Delta table.
- C
Enable real-time inference by deploying the model as a REST API.
- D
Set up a Databricks job to schedule the batch inference pipeline.
- E
Export the model to an external system for batch processing.
Show answer and explanation
Correct answers: A, B, D
Explanation
To deploy a model for batch inference in Databricks, the model should first be saved and registered using MLflow to ensure versioning and accessibility. A PySpark job is then written to load the model and apply it to the Delta table containing the data. Finally, a Databricks job is used to schedule the pipeline for regular execution. Real-time inference or exporting to external systems is not necessary for this use case, as it focuses on batch processing within Databricks.
- A. Correct.
Correct. Saving the trained model with MLflow and registering it in the model registry ensures that the model is versioned and can be accessed for deployment.
- B. Correct.
Correct. Writing a PySpark job allows you to load the registered model and apply it to the Delta table for batch inference.
- C. Incorrect.
Incorrect. Real-time inference via a REST API is not relevant for batch inference, as batch processing handles data in large groups rather than in real time.
- D. Correct.
Correct. Scheduling the batch inference pipeline using a Databricks job ensures that the batch process is automated and can run on a regular schedule.
- E. Incorrect.
Incorrect. While exporting the model to an external system is possible, Databricks provides built-in capabilities to handle batch inference without requiring external systems.