CERTIFIED-MACHINE-LEARNING-PROFESSIONAL · Question #15
CERTIFIED-MACHINE-LEARNING-PROFESSIONAL Question #15: Real Exam Question with Answer & Explanation
The correct answer is D: mlflow.pyfunc.load_model(model_uri). mlflow.pyfunc.load_model(model_uri) is correct because MLflow's pyfunc flavor is the standard, model-agnostic interface for batch deployment - it wraps the underlying sklearn model and exposes a unified .predict() method suitable for batch inference pipelines, regardless of the o
Question
A machine learning engineer has registered a sklearn model in the MLflow Model Registry using the sklearn model flavor with UI model_uri. Which of the following operations can be used to load the model as an sklearn object for batch deployment?
Options
- Amlflow.spark.load_model(model_uri)
- Bmlflow.pyfunc.read_model(model_uri)
- Cmlflow.sklearn.read_model(model_uri)
- Dmlflow.pyfunc.load_model(model_uri)
- Emlflow.sklearn.load_model(model_uri)
Explanation
mlflow.pyfunc.load_model(model_uri) is correct because MLflow's pyfunc flavor is the standard, model-agnostic interface for batch deployment - it wraps the underlying sklearn model and exposes a unified .predict() method suitable for batch inference pipelines, regardless of the original model flavor used during logging.
Why the distractors are wrong:
- A (
mlflow.spark.load_model) is for Spark MLlib models, not sklearn. - B (
mlflow.pyfunc.read_model) and C (mlflow.sklearn.read_model) don't exist - neither module has aread_modelfunction. - E (
mlflow.sklearn.load_model) does exist and returns the native sklearn estimator, but it is flavor-specific; for deployment workflows, MLflow convention favors thepyfuncinterface because it is portable and works across serving backends without modification.
Memory tip: Think of pyfunc as the "universal adapter" - no matter what flavor a model was saved with (sklearn, XGBoost, etc.), pyfunc.load_model can load it and hand back a consistent .predict() interface ready for batch scoring. When in doubt about deployment, reach for pyfunc.
Community Discussion
No community discussion yet for this question.