Abstract
Mean decrease in impurity (MDI) is a popular feature importance measure for random forests (RFs). We show that the MDI for a feature $X_k$ in each tree in an RF is equivalent to the unnormalized $R^2$ value in a linear regression of the response on the collection of decision stumps that split on $X_k$. We use this interpretation to propose a flexible feature importance framework called MDI+. Specifically, MDI+ generalizes MDI by allowing the analyst to replace the linear regression model and $R^2$ metric with regularized generalized linear models (GLMs) and metrics better suited for the given data structure. Moreover, MDI+ incorporates additional features to mitigate known biases of decision trees against additive or smooth models. We further provide guidance on how practitioners can choose an appropriate GLM and metric based upon the Predictability, Computability, Stability framework for veridical data science. Extensive data-inspired simulations show that MDI+ significantly outperforms popular feature importance measures in identifying signal features. We also apply MDI+ to two real-world case studies on drug response prediction and breast cancer subtype classification. We show that MDI+ extracts well-established predictive genes with significantly greater stability compared to existing feature importance measures. All code and models are released in a full-fledged python package on Github.
Introduction
Random Forests (RFs) are widely used for tabular data due to their ability to handle non-linearities and interactions automatically. However, they suffer from two major drawbacks: an inductive bias that struggles with smooth, additive relationships, and an interpretability measure (Mean Decrease in Impurity, or MDI) that is notoriously unstable and biased toward high-entropy features.
This paper introduces MDI+, a framework that bridges the gap between the predictive power of "black-box" Random Forests and the clear interpretability of Generalized Linear Models (GLMs). By reinterpreting decision trees as linear models fitted on engineered features, the authors provide a more accurate and stable way to understand feature importance.
Methodology: Trees as Linear Models
The core innovation of this work is the formalization of a link between trees and linear regression: a decision tree is essentially a linear model where the features are "local decision stumps" (the specific splits made in the tree).
RF+ and MDI+
Building on this insight, the authors propose two primary components:
- RF+: Instead of relying solely on a tree's predicted leaf values, RF+ extracts "stump features" from a pre-fitted tree and uses them as inputs for a Regularized GLM (such as Ridge or Lasso). Crucially, the model is "augmented" by adding the original raw features back into the mix, allowing it to capture smooth, linear trends that standard trees often miss.
- MDI+: To rank feature importance, MDI+ uses the coefficients from the RF+ model. It replaces the standard training-set $R^2$ with an out-of-sample metric calculated via Leave-One-Out (LOO) cross-validation. This eliminates the "differential optimism bias" that makes standard MDI over-rely on noisy or high-entropy features.
This framework is highly flexible; analysts can swap the underlying GLM engine or loss function (e.g., Huber loss for outliers) to match their specific data structure.
Experimental Validation
The framework was tested across several diverse datasets:
- CCLE (Cancer Cell Line Encyclopedia): 24 independent regression tasks for drug response prediction.
- TCGA Breast Cancer: Multiclass classification for identifying cancer subtypes.
- Data-Inspired Simulations: Synthetic responses built on real covariate matrices to test the identification of "true" signal features under noise.
Key Results
- Improved Prediction: RF+ outperformed standard Random Forests in 23 out of 24 drug response tasks. By augmenting stump features with raw features, the model effectively "fixes" the blocky, staircase-like predictions typical of RFs.
- Superior Feature Ranking: In simulations, MDI+ improved the AUROC for identifying true signal features by more than 10% over competitors like SHAP or Permutation Importance.
- Biological Consistency: In the breast cancer study, MDI+ identified well-known driver genes (like ESR1 and GATA3) with significantly higher stability than existing methods. While other methods' rankings fluctuated wildly across data splits, MDI+ remained consistent.
Discussion and Future Work
While MDI+ provides a significant upgrade to tree-based interpretability, it still relies on the initial Random Forest to find relevant splits. If the initial RF fails to capture an interaction, the GLM layer may not be able to recover it. Additionally, fitting a regularized GLM for every tree is more computationally intensive than a standard RF, though the authors provide approximate formulas to maintain efficiency. Future work may extend this framework to other ensemble methods like XGBoost or LightGBM.
Summary updated