- Introduced by
- Geurts, P., Ernst, D., Wehenkel, L. (Extra Trees); Lundberg, S. M. (SHAP explainability layer)
- Year
- 2006 (Extra Trees); 2017 (SHAP integration)
- Type
- Ensemble (randomized trees) with post-hoc explainability
- Family
- Machine learning
What does it do?
Explainable Extra Trees pairs the Extremely Randomized Trees (Extra Trees) ensemble with post-hoc explanation methods, most commonly SHAP values, so that predictions can be decomposed into feature-level contributions.
The ensemble is the Geurts, Ernst and Wehenkel algorithm; the explanation layer is Shapley-value attribution as introduced by Lundberg and Lee. The name describes a workflow rather than a single established algorithm with its own originator.
The intuition behind the method
Extra Trees grows many decision trees, but unlike Random Forest it does not search for the best split threshold at each node. It draws thresholds at random from the observed range of each candidate feature, which lowers variance and makes each tree cheap to build. The trained ensemble is hard to read directly, so SHAP is applied afterwards: for each prediction, it splits the gap between that prediction and the average prediction into additive contributions, one per feature, based on Shapley values from cooperative game theory. The result can answer 'which features drove this prediction?' for a single case or across the dataset.
History
The Extra Trees algorithm was introduced by Geurts, Ernst and Wehenkel in a 2006 Machine Learning paper, as a randomised tree ensemble intended to reduce variance further than Random Forest. The SHAP framework, which supplies the explanation layer, was proposed by Lundberg and Lee in 2017. Combining the two is a practical workflow rather than a separately established algorithm with its own originating publication.
When to use it
Choose this approach when you need a flexible ensemble on tabular data and must also explain individual predictions or rank feature contributions, for example in risk scoring or scientific feature screening where reviewers ask how a decision was reached. It is suited to medium-to-large datasets with continuous or encoded categorical features where relationships may be nonlinear or involve interactions. Do not use it when a transparent parametric model such as linear or logistic regression meets the question and stakeholders expect explicit coefficients. It is also a poor choice for very small samples, where tree ensembles overfit and SHAP estimates become unstable.
Limitations and considerations
- The raw ensemble is not interpretable on its own; explanations depend entirely on the SHAP layer, and attributions for strongly correlated features can be spread across those features in ways that need careful reading.
- Computing SHAP values adds time and memory cost, which grows with the size of the forest and the dataset.
- On small samples the ensemble can overfit, and the attributions computed from it inherit that instability.
- Standard implementations require categorical features to be encoded numerically, so mixed feature types must be prepared before fitting. The encoding choice (for example one-hot or ordinal encoding) is a user decision that affects both the fitted model and the SHAP attributions for those features.
- No explicit coefficients are produced; journals or regulators that expect a parametric model may not accept SHAP plots as a substitute.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Random threshold selection removes the per-candidate search for an optimal cut, so each split is cheaper to evaluate than in an exhaustively optimised tree.
- Averaging many randomised trees reduces variance relative to a single decision tree, without requiring bootstrap resampling by default.
- SHAP attributions are additive, so the contributions for an instance sum to the gap between its prediction and the average prediction, supporting both per-case and dataset-level explanations. Tree-specific algorithms (TreeSHAP) are available for computing them efficiently for tree ensembles.
- No distributional assumptions are placed on the features, so nonlinear effects and interactions are captured without manual specification of them.
- Global SHAP importance is computed from per-instance contributions rather than from split impurity, and can be less affected by the bias toward high-cardinality features sometimes reported for impurity-based importance.
Applications
- Clinical risk prediction where individual patient-level explanations are needed for review.
- Credit scoring and fraud detection where individual decisions must be justified to a reviewer.
- Biomarker or genomic feature screening with a transparent ranking of candidate variables.
- Environmental and ecological modelling where stakeholders need to see which drivers dominate predictions.
- Sensor or equipment monitoring where fast retraining and per-alert explanations are useful.
- Educational data analysis that identifies and explains factors associated with at-risk outcomes.
How it works
How it works
An ensemble of decision trees is grown on the training set; by default, unlike Random Forest, each tree uses the full training set rather than a bootstrap sample. At each node a random subset of features is considered, and for each candidate feature the split threshold is drawn uniformly at random between the feature's observed minimum and maximum, instead of being chosen by an exhaustive search. Because both the feature subset and the threshold are random, the trees are more decorrelated from one another than in Random Forest.
Each tree assigns its leaf value, and the ensemble aggregates these: classification outputs are combined across trees, and regression takes the average of the tree outputs. Because thresholds are not optimised, individual trees are inexpensive to build, which keeps training of large forests manageable.
Formula
\hat{y} = \text{mode/mean across } T \text{ fully random trees}SHAP values assign each feature a contribution to the difference between the model's prediction for a given instance and the average prediction over the data. They satisfy the Shapley axioms (efficiency, symmetry, dummy and additivity), so the contributions sum exactly to the prediction gap. For tree ensembles, dedicated tree-based algorithms (TreeSHAP) are used in practice to compute these values efficiently; the exactness and computational cost of a calculation depend on the implementation used.
Formula
\phi_i = \sum_{S \subseteq F \setminus \{i\}} \frac{|S|!(|F|-|S|-1)!}{|F|!}[v(S\cup\{i\})-v(S)]Averaging the absolute SHAP values over all instances gives a global feature ranking based on each feature's contribution to predictions. Impurity-based importance, computed from split criteria, can rank features differently and can be biased toward features with many distinct values, so the two should not be treated as interchangeable. SHAP magnitudes are measured in units of the model output and are not interchangeable with regression coefficients, so the ranking should be read as a ranking, not as an effect size.
For a single instance, SHAP produces a force plot or waterfall chart showing which features moved the prediction above or below the baseline and by how much. This instance-level view is useful where an individual decision must be justified, such as in clinical or credit settings.
Common pitfalls
- Reporting impurity-based (Gini or entropy) importance alongside or instead of SHAP values, which can rank features differently and can be biased toward features with many distinct values.
- Computing SHAP values on the training data without a held-out test set or cross-validation, so that explanations describe overfitted behaviour.
- Ignoring class imbalance: Extra Trees does not resample internally, so class weights or resampling must be applied before fitting.
- Reading SHAP values as causal effects; they describe the model's associations and are not causal without additional assumptions.
- Using default settings without checking stability; if the mean absolute SHAP values or the top-feature ranking shift noticeably across refits with different random seeds or numbers of trees, the explanation is not yet stable enough to report.
Frequently asked questions
How does Explainable Extra Trees differ from Explainable Random Forest?
The ensemble differs: Extra Trees draws split thresholds at random rather than optimising them, and by default uses the full training set for each tree rather than bootstrap samples. Both can use SHAP in the same way, so the explanation layer does not change. Whether accuracy or training time favours one method depends on the dataset and should be checked by cross-validation.
Are SHAP values from a tree model exact or approximate?
Tree-specific SHAP algorithms (TreeSHAP) are designed for tree ensembles. Whether a given computation is exact depends on the algorithm and implementation used, so the documentation of the library should be checked. Interpretation still depends on how the computation treats feature dependence, and when features are strongly correlated, contributions can be distributed among them in ways that need careful reading.
How many trees do I need for stable SHAP estimates?
Adding trees generally reduces the variance of the ensemble's predictions, but no universal number is established here. One informal check is to refit with increasing numbers of trees and different random seeds, and to compare the top-feature ranking across refits. If the ranking changes substantially between refits, the explanation is not yet stable enough to report.
Can I use this method for multi-class classification?
Yes. Extra Trees handles multi-class problems, and SHAP can be computed for each class, giving one set of attributions per class that shows which features push the prediction toward or away from that class.
What is the minimum sample size?
No hard minimum is established here. Tree ensembles tend to overfit on small samples, and SHAP attributions computed from them become unstable. For small datasets, a regularised linear or logistic model with explicit coefficients is a more transparent alternative.
Related methods
Sources
Geurts, P., Ernst, D., & Wehenkel, L. (2006). Extremely randomized trees. Machine Learning, 63(1), 3–42.
Open DOI referenceLundberg, S. M., & Lee, S.-I. (2017). A unified approach to interpreting model predictions. Advances in Neural Information Processing Systems, 30.
Open publication reference