# To tune or not to tune the number of trees in random forest?

arXiv: https://arxiv.org/abs/1705.05654 · HTML: https://mlsanity.com/paper/1705.05654/

## Key facts

- Cited by 33 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 16 May 2017.

## Built on by (most cited first, 30 of 33)

- [Hyperparameter Optimization: Foundations, Algorithms, Best Practices and Open Challenges](https://mlsanity.com/paper/2107.05847/) (2021)
- [Adversarial random forests for density estimation and generative modeling](https://mlsanity.com/paper/2205.09435/) (2022)
- [Geometry- and Accuracy-Preserving Random Forest Proximities](https://mlsanity.com/paper/2201.12682/) (2022)
- [Adaptive deep learning for nonlinear time series models](https://mlsanity.com/paper/2207.02546/) (2022)
- [AutoScore-Survival: Developing interpretable machine learning-based time-to-event scores with right-censored survival data](https://mlsanity.com/paper/2106.06957/) (2021)
- [Are Ensembles Getting Better all the Time?](https://mlsanity.com/paper/2311.17885/) (2023)
- [Inducing a hierarchy for multi-class classification problems](https://mlsanity.com/paper/2102.10263/) (2021)
- [Meta-Learning for Symbolic Hyperparameter Defaults](https://mlsanity.com/paper/2106.05767/) (2021)
- [Free Lunch in the Forest: Functionally-Identical Pruning of Boosted Tree Ensembles](https://mlsanity.com/paper/2408.16167/) (2024)
- [A Survey on Automated Sarcasm Detection on Twitter](https://mlsanity.com/paper/2202.02516/) (2022)
- [A Dataset-Level Geometric Framework for Ensemble Classifiers](https://mlsanity.com/paper/2106.08658/) (2021)
- [Oblique and rotation double random forest](https://mlsanity.com/paper/2111.02010/) (2021)
- [Exogenous Randomness Empowering Random Forests](https://mlsanity.com/paper/2411.07554/) (2024)
- [When do Random Forests work?](https://mlsanity.com/paper/2504.12860/) (2025)
- [Adapting tree-based multiple imputation methods for multi-level data? A simulation study](https://mlsanity.com/paper/2401.14161/) (2024)
- [Understanding overfitting in random forest for probability estimation: a visualization and simulation study](https://mlsanity.com/paper/2402.18612/) (2024)
- [Can a Single Tree Outperform an Entire Forest?](https://mlsanity.com/paper/2411.17003/) (2024)
- [How Many Trees in a Random Forest? A Revisited Approach with Plateau Search and Optuna Integration](https://mlsanity.com/paper/2606.03549/) (2026)
- [Experimental Investigation and Evaluation of Model-based Hyperparameter Optimization](https://mlsanity.com/paper/2107.08761/) (2021)
- [Noise-Resilient Ensemble Learning using Evidence Accumulation Clustering](https://mlsanity.com/paper/2110.09212/) (2021)
- [Machine Learning-based Prediction of Porosity for Concrete Containing Supplementary Cementitious Materials](https://mlsanity.com/paper/2112.07353/) (2021)
- [AutoScore-Ordinal: An interpretable machine learning framework for generating scoring models for ordinal outcomes](https://mlsanity.com/paper/2202.08407/) (2022)
- [Machine Learning to Support Triage of Children at Risk for Epileptic Seizures in the Pediatric Intensive Care Unit](https://mlsanity.com/paper/2205.05389/) (2022)
- [Distributional Adaptive Soft Regression Trees](https://mlsanity.com/paper/2210.10389/) (2022)
- [Benchmarking optimality of time series classification methods in distinguishing diffusions](https://mlsanity.com/paper/2301.13112/) (2023)
- [Heterogeneous Oblique Double Random Forest](https://mlsanity.com/paper/2304.06788/) (2023)
- [Does it pay to optimize AUC?](https://mlsanity.com/paper/2306.01528/) (2023)
- [Linear time Evidence Accumulation Clustering with KMeans](https://mlsanity.com/paper/2311.09272/) (2023)
- [The theoretical limits of biometry](https://mlsanity.com/paper/2312.00019/) (2023)
- [Bootstrap Sampling Rate Greater than 1.0 May Improve Random Forest Performance](https://mlsanity.com/paper/2410.04297/) (2024)

## Abstract (arXiv)

The number of trees T in the random forest (RF) algorithm for supervised learning has to be set by the user. It is controversial whether T should simply be set to the largest computationally manageable value or whether a smaller T may in some cases be better. While the principle underlying bagging is that "more trees are better", in practice the classification error rate sometimes reaches a minimum before increasing again for increasing number of trees. The goal of this paper is four-fold: (i) providing theoretical results showing that the expected error rate may be a non-monotonous function of the number of trees and explaining under which circumstances this happens; (ii) providing theoretical results showing that such non-monotonous patterns cannot be observed for other performance measures such as the Brier score and the logarithmic loss (for classification) and the mean squared error (for regression); (iii) illustrating the extent of the problem through an application to a large number (n = 306) of datasets from the public database OpenML; (iv) finally arguing in favor of setting it to a computationally feasible large number, depending on convergence properties of the desired performance measure.
