Databricks Machine Learning Professional Question 69
Select 3A data science team is developing a custom machine learning model in Databricks. They decide to include preprocessing logic within the custom model class. What are the benefits of including preprocessing logic and context within the custom model class?
- A
It ensures the preprocessing steps are tightly coupled with the model, reducing the risk of mismatched transformations during inference.
- B
It increases model portability by allowing preprocessing logic to be shared seamlessly when the model is deployed.
- C
It eliminates the need for separate preprocessing pipelines in training and inference, ensuring consistency.
- D
It allows the preprocessing logic to be automatically optimized by Databricks AutoML during model training.
- E
It reduces the size of the model artifact by storing preprocessing logic separately from the model parameters.
Show answer and explanation
Correct answers: A, B, C
Explanation
Including preprocessing logic and context in custom model classes provides key benefits such as reducing the risk of mismatched preprocessing during inference, improving model portability, and ensuring consistent preprocessing across training and inference. These practices are essential for robust model management and deployment. However, Databricks AutoML does not optimize custom preprocessing logic, and bundling preprocessing logic with the model does not reduce the model artifact size.
- A. Correct.
Including preprocessing logic within the custom model class ensures that the transformations applied during training are identical to those applied during inference, reducing potential errors from mismatched preprocessing steps.
- B. Correct.
By embedding preprocessing logic into the custom model class, the entire pipeline (preprocessing + model) can be easily transferred and reused in different environments, increasing portability.
- C. Correct.
Having preprocessing logic in the model class eliminates the need for separate preprocessing pipelines, ensuring consistent application of transformations in both training and inference stages.
- D. Incorrect.
Databricks AutoML does not automatically optimize custom preprocessing logic within a model class. This is a misunderstanding of the platform's capabilities.
- E. Incorrect.
Storing preprocessing logic within the model class does not reduce the size of the model artifact. Instead, it typically increases it since both the preprocessing and model logic are bundled together.