Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Exam Databricks Machine Learning Professional Topic 3 Question 37 Discussion

Actual exam question for Databricks's Databricks Machine Learning Professional exam
Question #: 37
Topic #: 3
[All Databricks Machine Learning Professional Questions]

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?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Kerry
2 days ago
I think we practiced a similar question where we had to retrieve model artifacts. I feel like option C is the right one since it specifies sklearn.
upvoted 0 times
...
Mirta
8 days ago
I remember we discussed how to load models with MLflow, but I'm not sure if it's `mlflow.load_model` or `mlflow.sklearn.load_model`.
upvoted 0 times
...
Mozelle
13 days ago
Hmm, I'm not sure about this one. I'll have to review my notes on MLflow and model persistence to make the best choice.
upvoted 0 times
...
Selene
19 days ago
Ah, I think I've got it! The key is that the data scientist terminated their Spark cluster, so we need to use a method that doesn't rely on the Spark session.
upvoted 0 times
...
Farrah
24 days ago
Wait, I'm a bit confused. Isn't there something about Spark in the question? I wonder if that changes how we need to approach this.
upvoted 0 times
...
Lorean
30 days ago
Okay, let's see. I'm pretty sure I've used mlflow.load_model() before to restore a model, so that's my first guess.
upvoted 0 times
...
Lauran
1 month ago
Hmm, this looks like a tricky one. I'll need to think through the options carefully to make sure I don't miss anything.
upvoted 0 times
...
Tawna
7 months ago
Option C is the way to go. Hey, at least it's not asking us to restore the model from a backup tape or something!
upvoted 0 times
Lavera
6 months ago
Yeah, MLflow is a lifesaver when it comes to managing and restoring model objects.
upvoted 0 times
...
Arlene
6 months ago
Option C is definitely the right choice. MLflow makes it easy to load the model object.
upvoted 0 times
...
...
Patrick
7 months ago
I think D) This can only be viewed in the MLflow Experiments UI is incorrect because we need to access the feature_importances_ in the code
upvoted 0 times
...
Fairy
7 months ago
I'm going with C. Gotta love those scikit-learn-specific utilities, they make my life so much easier. *sarcasm intensifies*
upvoted 0 times
...
Ezekiel
7 months ago
I'm not sure, but I think A) mlflow.load_model(model_uri) might also work since it's a general model loading function in MLflow
upvoted 0 times
...
Bok
7 months ago
D is a joke, right? I'm not gonna look at feature importances in the MLflow UI, that's what the code is for!
upvoted 0 times
Hana
6 months ago
E) client.pyfunc.load_model(model_uri)
upvoted 0 times
...
Louvenia
6 months ago
C) mlflow.sklearn.load_model(model_uri)
upvoted 0 times
...
Quentin
6 months ago
A) mlflow.load_model(model_uri)
upvoted 0 times
...
...
Lea
7 months ago
I agree with Monroe, because mlflow.sklearn.load_model(model_uri) is specifically for loading scikit-learn models
upvoted 0 times
...
Glen
7 months ago
I'm not sure why you can't just use `mlflow.load_model()` to restore the model. Seems like a waste of time to have a separate function for scikit-learn models.
upvoted 0 times
Louis
6 months ago
I'm not sure why you can't just use `mlflow.load_model()` to restore the model. Seems like a waste of time to have a separate function for scikit-learn models.
upvoted 0 times
...
Dottie
6 months ago
C) mlflow.sklearn.load_model(model_uri)
upvoted 0 times
...
Wenona
7 months ago
A) mlflow.load_model(model_uri)
upvoted 0 times
...
...
Monroe
7 months ago
I think the correct answer is C) mlflow.sklearn.load_model(model_uri)
upvoted 0 times
...
Jutta
8 months ago
Option C looks like the correct answer. You can use `mlflow.sklearn.load_model()` to restore the original model object and access the `feature_importances_`.
upvoted 0 times
Kanisha
7 months ago
Great, thanks for confirming!
upvoted 0 times
...
Zena
7 months ago
Yes, you are correct. `mlflow.sklearn.load_model()` can be used to restore the model object.
upvoted 0 times
...
Irma
7 months ago
I think option C is the right choice.
upvoted 0 times
...
...

Save Cancel