Question 29
Domain 4: Deploy and operationalize machine learning solutionsWhat should you use to register the model?
Correct answer: A
Explanation
Use "mlflow.pyfunc" because MLflow’s PyFunc flavor is the standard interface for packaging and registering Python models in a generic, framework-agnostic way. It lets you register a model through the Python function model format rather than a specific library flavor.
Why each option is right or wrong
A. mlflow.pyfunc
MLflow’s generic Python model flavor is the one designed for packaging a model behind the PyFunc interface, and the registration API for that format is exposed through the `mlflow.pyfunc` module. In practice, you log/register it as a PyFunc model so MLflow can store it in the Model Registry with the standard `python_function` flavor, rather than tying it to a library-specific flavor such as sklearn or xgboost.
B. mlflow.autolog()
C. mlflow.log_params()
D. mlflow.<flavor>.load_model() **Correct answer:** A. mlflow.pyfunc **Explanation:** The `mlflow.pyfunc` module allows defining and registering custom models that combine different frameworks. It is not recommended to use `mlflow.autolog()` or `mlflow.log_params()` as they do not handle custom models properly, and `load_model()` is only used to load a model, not to register it. **Reference:** - [mlflow.pyfunc — MLflow Python Functions (pyfunc) Documentation](https://mlflow.org/docs/latest/python_api/mlflow.pyfunc.html) ---