Databricks Machine Learning Professional Question 70
Select 3You are designing a machine learning model in Databricks and need to include preprocessing logic directly within your custom model class. What are the benefits of embedding preprocessing steps and context into custom model classes for model management?
- A
It ensures that the preprocessing logic is versioned alongside the model for reproducibility.
- B
It minimizes the need for feature engineering when deploying the model in a production environment.
- C
It allows the model to automatically apply preprocessing at inference time, reducing the risk of data transformation mismatches.
- D
It limits the scalability of the model when deployed across distributed systems.
- E
It simplifies the integration of the model into pipelines by encapsulating both preprocessing and inference logic.
Show answer and explanation
Correct answers: A, C, E
Explanation
Including preprocessing logic and context within custom model classes ensures consistent transformations between training and inference, improves reproducibility, and simplifies integration into machine learning pipelines. These benefits are critical for managing models effectively in Databricks.
- A. Correct.
Including preprocessing logic in custom model classes ensures that the transformations applied during training are versioned alongside the model, which is critical for reproducibility.
- B. Incorrect.
While preprocessing steps can reduce manual transformations, they do not eliminate the need for feature engineering. Feature engineering is still essential for creating meaningful features.
- C. Correct.
Embedding preprocessing logic ensures that the same transformations are consistently applied at inference time, reducing the risk of errors caused by mismatched data transformations.
- D. Incorrect.
Embedding preprocessing logic does not inherently limit scalability. Scalability depends on how the model and logic are implemented, not whether preprocessing is included.
- E. Correct.
By encapsulating preprocessing and inference logic, custom model classes simplify the integration into machine learning pipelines, making them easier to use and maintain.