Certified Machine Learning Professional Exam QuestionsBrowse all questions from this exam

Certified Machine Learning Professional 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?

Show Answer
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

2 comments
Sign in to comment
BokNinjaOption: B
Dec 19, 2023

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

hugodscarvalhoOption: B
Jan 27, 2024

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