Exam Certified Machine Learning Professional All QuestionsBrowse all questions from this exam
Question 36

A data scientist has developed a scikit-learn model sklearn_model and they want to log the model using MLflow.

They write the following incomplete code block:

Which of the following lines of code can be used to fill in the blank so the code block can successfully complete the task?

    Correct Answer: B

    The correct line of code to log the scikit-learn model using MLflow is 'mlflow.sklearn.log_model(sklearn_model, "model")'. The 'mlflow.sklearn.log_model()' function is specifically designed for logging scikit-learn models and is properly formatted to complete the task as described in the problem.

Discussion
BokNinjaOption: B

B. import mlflow.sklearn # Log the model mlflow.sklearn.log_model(sklearn_model, "model")

hugodscarvalhoOption: B

Doc: https://mlflow.org/docs/latest/python_api/mlflow.sklearn.html#mlflow.sklearn.log_model