New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Machine Learning Professional Exam - 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:

0/2000 characters
Miriam
2 months ago
I’m not sure about D, I thought we could access it programmatically.
upvoted 0 times
...
Anika
2 months ago
Wait, can you really only view it in the UI? That seems odd!
upvoted 0 times
...
Sage
2 months ago
Definitely agree with C, it’s the proper way to load scikit-learn models.
upvoted 0 times
...
Luz
3 months ago
Option A is also a valid choice, but not for scikit-learn models.
upvoted 0 times
...
Ivan
3 months ago
I think option C is the right one!
upvoted 0 times
...
Alex
3 months ago
I thought we could only view feature importances in the UI, but I feel like there's a way to load the model directly too.
upvoted 0 times
...
Merlyn
3 months ago
I vaguely recall that `client.list_artifacts` is used for listing files, but I don't think it actually loads the model.
upvoted 0 times
...
Kerry
4 months 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
4 months 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
4 months 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
4 months 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
4 months 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
5 months 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
5 months 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
10 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
9 months ago
Yeah, MLflow is a lifesaver when it comes to managing and restoring model objects.
upvoted 0 times
...
Arlene
9 months ago
Option C is definitely the right choice. MLflow makes it easy to load the model object.
upvoted 0 times
...
...
Patrick
10 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
10 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
11 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
11 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
9 months ago
E) client.pyfunc.load_model(model_uri)
upvoted 0 times
...
Louvenia
9 months ago
C) mlflow.sklearn.load_model(model_uri)
upvoted 0 times
...
Quentin
10 months ago
A) mlflow.load_model(model_uri)
upvoted 0 times
...
...
Lea
11 months ago
I agree with Monroe, because mlflow.sklearn.load_model(model_uri) is specifically for loading scikit-learn models
upvoted 0 times
...
Glen
11 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
10 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
10 months ago
C) mlflow.sklearn.load_model(model_uri)
upvoted 0 times
...
Wenona
10 months ago
A) mlflow.load_model(model_uri)
upvoted 0 times
...
...
Monroe
11 months ago
I think the correct answer is C) mlflow.sklearn.load_model(model_uri)
upvoted 0 times
...
Jutta
11 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
10 months ago
Great, thanks for confirming!
upvoted 0 times
...
Zena
11 months ago
Yes, you are correct. `mlflow.sklearn.load_model()` can be used to restore the model object.
upvoted 0 times
...
Irma
11 months ago
I think option C is the right choice.
upvoted 0 times
...
...

Save Cancel