Does the number of trees hurt ensemble performance in regression?


Welcome!

Every Monday, I’ll drop a no-fluff, straight-to-the-point tip on a data science skill, tool, or
method to help you stay sharp in the field. I hope you find it useful!


This Friday is Black Friday!

This Friday is Black Friday! That means that you can get hold of our courses at a discounted price! Just a few more days to go.

Watch for our email later this week!


Does the number of trees hurt ensemble performance in regression?

Bagging and boosting train multiple decision trees that collectively produce a prediction. In bagging, we train several models in parallel, and then average their predictions. In boosting, we train the models in sequence, and each model “corrects” the errors of the previous ones.

Does adding more trees improve performance, or can it make things worse?

To find out, I trained random forests, AdaBoost, and gradient boosting machines on five regression datasets.

Does adding more trees hurt model performance?

For random forests, the answer is no. Across the datasets, test performance stayed essentially flat as trees were added. Averaging more independent trees did not hurt the predictions; it just took more time.

Boosting was more sensitive to the number of trees. AdaBoost showed the clearest deterioration: on some datasets, performance worsened substantially as the ensemble grew.

Gradient boosting was less affected. With the settings I used, performance was mostly stable, with modest deterioration on some datasets.

On artificial data, AdaBoost’s performance depended on the target distribution. Deterioration appeared when the target had outliers or was non-normal (green and orange lines).

Does transforming the target help with model performance in ensembles?

Transforming the target with a logarithm reduced the problem in several cases, but did not eliminate it. The number of trees is a parameter worth tuning for AdaBoost.

To wrap up

In these experiments, adding trees was safe for random forests, but not always for boosting. AdaBoost was the most sensitive, gradient boosting less so.

So while more trees are usually a reasonable way to stabilize a random forest, they are not automatically better in a boosting model. Keep an eye on performance as the ensemble grows, and tune the number of trees, especially for AdaBoost.

If you'd like to understand how boosting builds its trees and how to make the most of early stopping in XGBoost, LightGBM and CatBoost, check out our new course Master Tree Ensemble Models: From Decision Trees to Gradient Boosting.​

I hope this information was useful!

See you next Monday! 👋🏻

Sole


Ready to enhance your skills?

Our specializations, courses and books are here to assist you:


Hi…I’m Sole
​
I’m a Python developer, AI educator, and developer advocate. I’m the creator and maintainer of Feature-engine and the main instructor at Train in Data.
​
I share practical Python lessons, open-source insights, and ideas to help our community build better software and grow as developers and data scientists.

You are receiving this email because you subscribed to our newsletter, signed up on our website, purchased or downloaded any products from us.


Follow us on social media

Copyright (C) 2026 Train in Data. All rights reserved.

​
​Unsubscribe · Preferences​

Train in Data

by Soledad Galli, PhD | Data scientist | Python Developer | Best-selling instructor | Book author | 👉 www.trainindata.com

Read more from Train in Data

Welcome! Every Monday, I’ll drop a no-fluff, straight-to-the-point tip on a data science skill, tool, ormethod to help you stay sharp in the field. I hope you find it useful! Black Friday is around the corner! November is here, and that means Black Friday is just around the corner! Have you had your eye on one of our courses for a while, or been waiting for the right moment to get started? In 2 weeks, you can get hold of our courses and books at a discounted price! 👀 Black Friday is coming....

Your hyperparameter search is probably bigger than it needs to be

Welcome! Every Monday, I’ll drop a no-fluff, straight-to-the-point tip on a data science skill, tool, ormethod to help you stay sharp in the field. I hope you find it useful! Something exciting is coming this Black Friday! 👀 November is here, and that means Black Friday is just around the corner! Have you had your eye on one of our courses for a while, or been waiting for the right moment to get started? Well, we have something coming up that you might want to look out for! We're preparing...

After months with Claude and ChatGPT, here is where each one wins

Welcome! Every Monday, I’ll drop a no-fluff, straight-to-the-point tip on a data science skill, tool, ormethod to help you stay sharp in the field. I hope you find it useful! Our new course is out! Master Tree Ensemble Models: from Decision Trees to Gradient Boosting! XGBoost, LightGBM, and CatBoost are everywhere, and generative AI can now set them up in minutes. But can you explain what they are doing, why they make certain decisions, or whether the generated configuration makes sense?...