NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Unbiased Measurement of Feature Importance in Tree-Based Methods

Zhengze Zhou, Giles Hooker

Abstract

Standard feature importance measures in Random Forests, such as Gini importance, are notoriously biased toward continuous variables and high-cardinality categorical features. This bias often leads models to mistake noise for signal, complicating feature selection. We introduce Unbiased Feature Importance (UFI), a computationally efficient modification that utilizes out-of-sample data to ensure irrelevant features receive a zero importance score on average. Our results demonstrate that UFI effectively suppresses noise and recovers true signals, outperforming standard methods in both classification and regression tasks.

Introduction

Tree-based models like Random Forests and Gradient Boosting are essential tools in machine learning, yet they often function as "black boxes." To interpret these models, practitioners rely on feature importance scores, most commonly the "split-improvement" or Gini importance. This metric calculates the reduction in impurity (uncertainty) provided by each feature split.

However, a significant flaw exists: split-improvement is typically calculated on the same data used to train the tree. Features with many potential split points—such as continuous variables or high-cardinality categorical features—offer more opportunities to "accidentally" reduce impurity through overfitting. Consequently, these features receive artificially inflated importance scores. As shown in Figure 1, dummy features with varying cardinalities can exhibit substantial split improvement, with high-cardinality features (like X1) appearing significantly more "important" than others despite containing no signal.

Figure 1: Split improvement for dummy features in classification and regression, illustrating the inherent bias toward high-cardinality features (e.g., X1).

Methodology: Unbiased Feature Importance (UFI)

To address this bias, we propose Unbiased Feature Importance (UFI). The core principle is to avoid evaluating a model on its training data. Instead of altering the tree-building process, UFI modifies how importance is calculated post-hoc.

For every split in a grown tree, the improvement is recalculated using data the tree has not seen—specifically, the Out-of-Bag (OOB) samples in a Random Forest.

  • Classification: The Gini index is modified to incorporate test-set class proportions. If a split was merely "lucky" on training data, the test-set proportions will not align, causing the improvement score to drop toward zero.
  • Regression: The training split-improvement is combined with a test-set version. Since test-set improvement can be negative if a split increases error on new data, it effectively cancels out the positive bias from the training phase.

This approach ensures a "zero-expectation" property: if a feature is independent of the target variable, its expected UFI score is exactly zero.

Experimental Evaluation

We validated UFI using a combination of synthetic and real-world benchmarks, including simulated data with noise features of varying cardinalities, RNA sequence data, and classic datasets like the UCI Adult and Boston Housing datasets.

Results and Discussion

UFI demonstrates a remarkable ability to suppress noise and recover signal. In the "Adult" dataset, standard scikit-learn importance ranked a random noise variable as the 3rd most important feature. UFI correctly assigned it a score near zero.

Furthermore, Figure 2 illustrates how feature rankings evolve as the bias is corrected (represented by the parameter rho). In both classification and regression, the rankings of noise features shift significantly. For instance, in classification, a high-cardinality noise feature (X2) that initially appears most important (rank 1.0) is correctly demoted as rho increases, while the true signal (X3) ascends to the top rank. UFI consistently identifies informative features that standard methods might rank poorly due to competition from high-cardinality noise.

Figure 2: Average ranking of features as a function of the bias-correction parameter rho. The method stabilizes rankings, correctly identifying relevant features over noise.

The bias in feature importance is essentially a form of node-level overfitting. Just as training error is an optimistic estimate of generalization, standard split-improvement is an optimistic estimate of relevance. UFI provides a theoretically grounded "ground truth" that standard methods lack, remaining competitive with state-of-the-art unbiased methods like cforest while maintaining lower computational overhead.

Conclusion

UFI offers a robust and efficient solution for unbiased feature importance in tree-based models. While it effectively handles cardinality bias, future work should address challenges related to highly correlated features, where importance may be split between redundant predictors. Additionally, exploring the interaction between tree-building heuristics and UFI's independence assumptions will further refine its applicability across diverse machine learning tasks.

Summary updated

BibTeX
@article{zhou2019unbiased,
  author = {Zhengze Zhou and Giles Hooker},
  title = {{Unbiased Measurement of Feature Importance in Tree-Based Methods}},
  journal = {ACM Trans. Knowl. Discov. Data},
  year = {2019},
  doi = {10.1145/3429445},
}
Figure