Databricks-ML-Assoc Model Development Practice Question
A data scientist is evaluating feature importance for a tree-based model trained on Databricks. They want to understand which features contribute most to the model's predictions. Which TWO methods are appropriate for extracting feature importance from a scikit-learn Random Forest model? (Choose two.)
⚠ Common exam trap
The trap here is assuming that any model output or method can provide feature importance; only specific attributes or external libraries like SHAP do.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Access the feature_importances_ attribute of the fitted model.
The feature_importances_ attribute of a fitted Random Forest provides a quick, impurity-based measure of global feature importance. SHAP values offer a more detailed, model-agnostic approach that attributes each feature's contribution to individual predictions, which can be aggregated for global importance. Both are valid methods for understanding feature influence. The other options do not yield feature importance: predict_proba returns probabilities, decision function coefficients are for linear models, and get_params returns hyperparameters.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Access the feature_importances_ attribute of the fitted model.
Why this is correct
Scikit-learn's Random Forest model exposes a feature_importances_ attribute after fitting. This attribute provides a normalized array of importance scores based on impurity decrease. It is a straightforward and computationally efficient way to get a global ranking of feature importance, which is suitable for understanding which features contribute most to the model's predictions.
- ✗
Examine the coefficients of the model's decision function.
Why it's wrong here
Random Forest models do not have coefficients like linear models. They are ensembles of decision trees, and their decision function is not based on a linear combination of features. Therefore, there are no coefficients to examine for feature importance. This method is applicable to linear models, not tree-based ensembles.
- ✓
Use SHAP (SHapley Additive exPlanations) values to compute feature importance.
Why this is correct
SHAP values provide a unified measure of feature importance by computing the contribution of each feature to individual predictions. For tree-based models, the shap package offers efficient implementations like TreeExplainer. Aggregating absolute SHAP values across the dataset yields global feature importance, which can capture non-linear relationships and interactions, offering deeper insights than impurity-based importance.
- ✗
Use the model's get_params method to retrieve feature importance.
Why it's wrong here
get_params returns the hyperparameters of the model, such as n_estimators or max_depth. It does not provide any information about feature importance. Hyperparameters control the learning process but do not indicate which features are most influential. This method is used for model inspection and cloning, not for feature importance analysis.
- ✗
Use the model's predict_proba method to derive feature importance.
Why it's wrong here
predict_proba returns class probabilities for each input sample. It does not provide any information about feature importance. While you could analyze how predictions change when features are perturbed, predict_proba alone does not yield importance scores. It is not a method for extracting feature importance directly.
About these practice questions
Courseiva writes every Databricks-ML-Assoc question from scratch — 319 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-ML-Assoc practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-ML-Assoc exam.