QuestionQ13

VerifiedCustom Model Serving

A machine learning engineer wants to log and deploy a model as an MLflow pyfunc model. They have custom preprocessing that must be performed on feature variables before fitting the model or generating predictions with it. They choose to wrap this preprocessing in a custom model class, ModelWithPreprocess, where preprocessing occurs when fit and predict are called. They then log the fitted ModelWithPreprocess model as a pyfunc model.

Which of the following is a benefit of this approach when the logged pyfunc model is loaded for downstream deployment?

Explanation

The loaded pyfunc model retains the custom model wrapper. Its predict method executes the embedded preprocessing logic before producing predictions, ensuring inference inputs are transformed consistently with the fitted model.

Community Discussion

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