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

A data scientist has developed and logged a scikit-learn random forest model model, and then they ended their Spark session and terminated their cluster. After starting a new cluster, they want to review the feature_importances_ of the original model object.

Which of the following lines of code can be used to restore the model object so that feature_importances_ is available?

    Correct Answer: C

    To restore a scikit-learn random forest model and access its feature_importances_ attribute, the appropriate function to use is mlflow.sklearn.load_model(model_uri). This function is specifically designed to load models built using scikit-learn.

Discussion
trendy01Option: C

C. mlflow.sklearn.load_model(model_uri) for two different case, write different code 1. sklean : mlflow.sklearn.load_model(model_uri) 2. xgboost : mlflow.xgboost.load_model(model_uri)

BokNinjaOption: C

The correct answer is C. mlflow.sklearn.load_model(model_uri)

Alishahab70Option: C

C is correct

hugodscarvalhoOption: C

This line of code loads the scikit-learn model from the specified model URI, allowing you to access its attributes such as feature_importances. Doc: https://mlflow.org/docs/latest/python_api/mlflow.sklearn.html#mlflow.sklearn.load_model

random_data_guyOption: C

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