- Introduced by
- Deng, H. & Runger, G.
- Year
- 2012
- Type
- Regularized ensemble (penalized feature selection in trees)
- Family
- Machine learning
What does it do?
Regularized Random Forest (RRF), introduced by Houtao Deng and George Runger in 2012, extends the standard Random Forest with a penalty that discourages splits on features not already used in the ensemble.
The penalty is intended to produce smaller, less redundant feature subsets, so the method is most useful when feature selection matters alongside predictive accuracy.
The intuition behind the method
In a standard Random Forest, each tree chooses the split with the largest gain at each node, so several correlated features that carry similar information can all receive high use and importance. RRF changes this incentive: a feature not yet used in the ensemble has its gain multiplied by lambda (between 0 and 1) before it competes for a split, so it must be clearly better than a feature already in use. A smaller lambda imposes a stronger penalty on new features and pushes the forest toward a compact set of features. When lambda equals one, the penalty disappears and the model reduces to an ordinary Random Forest. Selection is therefore built into fitting rather than applied as a separate importance ranking afterwards.
History
Houtao Deng and George Runger introduced Regularized Random Forest in a 2012 IJCNN paper on feature selection via regularized trees, which applied the framework to random forest and boosted trees. Their 2013 paper in Pattern Recognition extended the approach to gene selection with guided regularized random forest (GRRF), which allows prior importance information to be used. The 2012 abstract describes the core idea as penalizing a new feature when its gain is similar to features used in earlier splits.
When to use it
Choose Regularized Random Forest when you need both predictive accuracy and a compact feature subset, for example in high-dimensional biomarker discovery or gene selection, where candidate features greatly outnumber observations. It is a reasonable choice when you want fewer features than a standard Random Forest and its importance output looks redundant, and when the data are tabular with mixed variable types. Whether it yields more stable importance rankings must be verified on your data. Do not use it when all features are expected to be informative and no selection is wanted, when the sample is too small for reliable tuning and error estimation, or when explicit coefficients and confidence intervals for individual feature effects are required; regularized logistic or linear regression is more suitable in that last case. Lambda must be tuned with care, since too small a value can exclude features that are genuinely useful.
Limitations and considerations
- Adds lambda and, in GRRF, an importance weight. These must be tuned, typically by cross-validation, and results depend on their values.
- The penalty depends on which features have already been used, so trees cannot be grown independently as in a standard Random Forest. Its computational cost relative to a standard Random Forest should be checked on large problems.
- With small samples, both the penalized selection and the out-of-bag error estimate are less reliable, because there are few observations to separate informative features from chance patterns.
- It remains a tree ensemble and does not give explicit coefficients or confidence intervals for individual feature effects.
- A very small lambda penalizes every new feature strongly, which can limit the variety of features the forest draws on compared with a standard Random Forest.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Combines feature selection and prediction in one fitting procedure, so no separate variable-selection stage is needed before the forest is grown.
- The penalty on features not yet in use is designed to reduce redundant, correlated features in the selected set. Deng and Runger (2012) report experiments in which regularized trees selected high-quality feature subsets for both strong and weak classifiers.
- The 2012 abstract notes that tree models in general handle categorical and numerical variables, differences in scale, and interactions and nonlinearities. Missing-value handling depends on the software implementation, so check it before use.
- Inherits the bagging and tree-averaging structure of Random Forest. Whether the forest resists overfitting on a given dataset must be checked on held-out data.
- The guided variant (GRRF, Deng and Runger 2013, applied to gene selection) allows prior importance scores to steer selection toward features that domain knowledge favours.
Applications
- Gene selection and biomarker discovery in genomics, where many candidate features compete on a limited number of samples (Deng and Runger 2013).
- Feature selection in high-dimensional tabular classification tasks where a compact feature subset is needed for downstream analysis.
- Feature screening before fitting an interpretable model such as logistic regression or a decision tree.
- Supervised tasks in which standard Random Forest importance rankings are redundant or unstable and a smaller feature set is needed.
How it works
How it works
As in standard Random Forest, each tree is trained on a bootstrap sample drawn with replacement from the training data. Out-of-bag observations, those not drawn for a given tree, can be used to estimate error. Because the features are chosen by trees trained on the same data, this estimate can be optimistic, as discussed under pitfalls.
At each candidate split, the gain of each feature is compared after penalization. A feature not yet used in the ensemble has its gain multiplied by lambda (0 < lambda <= 1), while a feature already in use keeps its full gain. This discourages new features that are only marginally better from entering the model.
Formula
\text{Gain}_{\text{reg}}(f) = \begin{cases} \text{Gain}(f) & \text{if } f \in F_{\text{used}} \\ \lambda \cdot \text{Gain}(f) & \text{otherwise} \end{cases}Trees are grown to full depth or to a user-specified maximum, using the regularized gain at each split. Because the penalty depends on which features have already been used, choices made in earlier trees affect later ones. The 2012 abstract frames the penalty as applying to a new feature whose gain is similar to features used in previous splits.
The final prediction combines all T regularized trees: a majority vote (mode) for classification and the mean of tree predictions for regression. Because the penalty discourages reuse of new features, the forest is intended to concentrate on a smaller set of features than a standard Random Forest. Whether the resulting importance rankings are more stable on a given dataset should be checked empirically.
Formula
\hat{y} = \text{mode/mean of } T \text{ regularized trees}Common pitfalls
- Setting lambda to 1 removes the penalty entirely, so the model is an ordinary Random Forest and the regularization gives no benefit.
- Reporting only out-of-bag error. The features are chosen using the same training data, so OOB error may be optimistic. Use a held-out test set, or cross-validation that repeats the selection within each fold.
- Interpreting the selected subset as complete. A feature not yet in use is penalized, so a correlated feature that carries some independent signal may be left out.
- Treating the selected features as causal. The criterion ranks features by gain, which reflects usefulness for prediction, not causal effect.
- Skipping a baseline comparison. Confirm on the specific dataset that RRF generalizes better than a standard Random Forest rather than assuming the regularization helps.
Frequently asked questions
What does the lambda parameter control?
Lambda, between 0 and 1, multiplies the gain of any feature not yet used in the forest. A lambda of 1 leaves gains unchanged and gives standard Random Forest behaviour. Smaller values impose a stronger penalty on new features and favour reuse of features already selected. The method does not fix its value, so it is usually chosen by cross-validation.
How is RRF different from standard Random Forest with post-hoc feature selection?
A common workflow fits a standard Random Forest, ranks features by importance, and refits a model on the top features, which is a two-stage process. RRF builds the selection into the splitting criterion, so the feature set and the forest are shaped together. Whether this gives more stable or parsimonious results should be checked on the data at hand.
When should I use the Guided variant (GRRF) instead of plain RRF?
Use GRRF when you have prior knowledge, such as published findings or domain expertise, about which features are likely informative. GRRF accepts prior importance scores that bias the regularization toward those features (Deng and Runger 2013).
Does RRF work for regression as well as classification?
Yes, regression is listed for RRF: the RRF R package provides regularized random forest models, and the method codes 'RRF' and 'RRFglobal' are listed for both classification and regression in the caret model listing. The mechanics use mean aggregation for regression. Regression behaviour should still be checked in the package documentation and the original papers before relying on it for a regression task.
Is the out-of-bag error still valid in RRF?
OOB error is available, but because the features are selected on the same training data, it may be optimistic. Confirm generalization on a held-out test set or with cross-validation that repeats the selection in each fold.
Related methods
Sources
Deng, H., & Runger, G. (2012). Feature selection via regularized trees. Proceedings of the 2012 International Joint Conference on Neural Networks (IJCNN), IEEE, pp. 1–8.
Open DOI referenceDeng, H., & Runger, G. (2013). Gene selection with guided regularized random forest. Pattern Recognition, 46(12), 3483–3489.
Open DOI referenceVeri Madenciliğinde Kullanılan Kümeleme Algoritmaları R Örnekleri, p. 187