QuestionQ29

Custom Model Serving

A Data Scientist is developing a product-recommendation model for an online merchant that proposes additional items from a customer’s current shopping basket. To prevent recommending items already in the basket, the model must access the real-time basket contents during inference. The model will be deployed with Databricks Model Serving. The data scientist now needs to implement real-time feature engineering so that the current basket contents are incorporated into the model’s prediction.

Which approach accomplishes this?

  • A Create a custom pyfunc model that processes the basket contents as part of the model’s predict() method.
  • B Write basket data to a feature table and publish to the online store for low-latency access.
  • C Store basket data in a Delta table and configure automatic feature lookup during model serving.
  • D Implement feature preprocessing in a separate microservice that feeds the model serving endpoint.
Explanation

A custom MLflow pyfunc model can receive the current basket as request input and run basket-specific preprocessing and filtering within predict() for each inference request. Databricks Model Serving supports custom pyfunc code for preprocessing and per-request logic, making it suitable for dynamic features that exist only at scoring time.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!