Improving Random Forests by Smoothing

Ziyi Liu, Phuc Luong, Mario Boley, Daniel F. SchmidtarXiv 2025 · DOI

Introduction

Random Forests (RFs) are a staple of machine learning due to their spatial adaptivity and robustness. However, in small-data regimes (10–500 samples), their piecewise constant nature—often referred to as the "staircase" effect—limits their performance. This paper introduces Smoothed Random Forests (SRF), a post-hoc technique that transforms these jagged predictions into smooth, differentiable functions, significantly improving both accuracy and uncertainty quantification.

The Problem: Spatial Adaptivity vs. Smoothness

Model selection for small datasets often involves a trade-off between Gaussian Processes (GPs) and Random Forests. GPs offer excellent uncertainty quantification and smoothness but lack spatial adaptivity, assuming a uniform degree of smoothness across the input space. Conversely, RFs excel at spatial adaptivity by partitioning the space into hyper-rectangles, but their predictions are non-differentiable and struggle with interpolation between sparse points.

Comparison of standard Random Forest (left), Smoothed Random Forest (middle), and the smoothing kernel mechanism (right).

Methodology: Smoothing the "Staircase"

The authors propose a post-learning smoothing mechanism that modifies the forest's output without altering the underlying tree-building process.

The Smoothing Kernel

For any query point $x_0$, the SRF model places a Gaussian kernel over it and calculates the expected value of the tree's prediction. Since decision trees consist of axis-parallel boxes, this integral has a closed-form solution using Cumulative Distribution Functions (CDFs). This makes the smoothed prediction a weighted average of all leaves, where weights are determined by the kernel's overlap with each leaf.

Visualization of the Gaussian kernel (concentric circles) centered at a query point (red x) used to weight leaf contributions.

Uncertainty and Calibration

Beyond standard inter-model variance, SRF introduces intra-model variance to account for the uncertainty in tree split locations. The authors demonstrate that split-point variability under resampling follows a Laplace distribution, which the smoothing kernel effectively simulates. The smoothing parameter ($\lambda$) and calibration constants are tuned using Out-of-Bag (OOB) data.

Key Results

The SRF model was evaluated on 14 real-world datasets from the UCI repository. Key findings include:

  • Superior Accuracy: SRF(local) consistently outperformed standard RFs, with Mean Squared Error (MSE) improvements of 10–20% on datasets like Facebook and Yacht Hydrodynamics.
  • Better Uncertainty (Log-Loss): The model's ability to quantify uncertainty was significantly better than standard RFs. In the Facebook dataset, the improvement in log-loss exceeded 70%.
  • Differentiability: Unlike standard RFs, SRFs are fully differentiable, enabling their use in gradient-based optimization tasks like Bayesian Optimization.

Conclusion

Smoothed Random Forests bridge the gap between the local flexibility of trees and the mathematical elegance of smooth kernels. By addressing the "staircase" limitation, SRFs provide a powerful tool for high-precision modeling and honest uncertainty quantification in data-scarce environments.

Summary updated

BibTeX
@misc{liu2025improving,
  author = {Ziyi Liu and Phuc Luong and Mario Boley and Daniel F. Schmidt},
  title = {{Improving Random Forests by Smoothing}},
  year = {2025},
  eprint = {2505.06852},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.06852},
}
Figure