Random forest
- Trees
- 100.
- Features
- sqrt.
- Depth
- Unlimited.
Loading…
Random forest averages many trees grown on bootstrap samples. Gradient boosting adds trees of depth 3 that correct the remaining error. These runs use learning rate 0.1, and the published score is hold-out accuracy on a stratified 25% split.
Do you need a bagged vote of trees?
A vote of bootstrap trees, or trees that correct the remaining error.
Random forest has the higher hold-out accuracy on Customer Segments; Gradient boosting has the higher hold-out accuracy on Iris Flowers; Hold-out accuracy is within 0.01 on Wine (UCI wine recognition).
Choose the score the table needs.
This is a choice, not a measured winner.
Iris Flowers has 150 rows and 4 columns. The bagged forest, 100 trees with a sqrt feature draw at every split, scores hold-out accuracy 0.921 and macro F1 0.923 from 38 test rows. Gradient boosting fits 100 stages at learning rate 0.1 with trees of depth 3 and scores accuracy 0.947 and macro F1 0.949 on that same hold-out. Each picture shows those test rows on a two-component PCA plane, colored by the predicted label. Gradient boosting has the higher hold-out accuracy on this split.
Gradient boosting used 100 trees, depth 3, and learning rate 0.1, with no early stopping, on about 112 training rows. Random forest used bagged trees. That is why 0.947 beat 0.921 on this split.


The link loads the sample when the classification tool has it. Run is still required.
Wine (UCI wine recognition) has 178 rows and 13 columns. The bagged forest, 100 trees with a sqrt feature draw at every split, scores hold-out accuracy 1.000 and macro F1 1.000 from 45 test rows. Gradient boosting fits 100 stages at learning rate 0.1 with trees of depth 3 and scores accuracy 1.000 and macro F1 1.000 on that same hold-out. Each picture shows those test rows on a two-component PCA plane, colored by the predicted label. Hold-out accuracy is within 0.01 on this split.


The link loads the sample when the classification tool has it. Run is still required.
Customer Segments has 200 rows and 5 columns. The bagged forest, 100 trees with a sqrt feature draw at every split, scores hold-out accuracy 0.900 and macro F1 0.899 from 50 test rows. Gradient boosting fits 100 stages at learning rate 0.1 with trees of depth 3 and scores accuracy 0.880 and macro F1 0.879 on that same hold-out. Each picture shows those test rows on a two-component PCA plane, colored by the predicted label. Random forest has the higher hold-out accuracy on this split. The classification tool does not load this sample; the published runs used the segment column that ships with the table.
Gradient boosting used 100 trees, depth 3, and learning rate 0.1, with no early stopping, on about 150 training rows. Random forest used bagged trees. That is why 0.900 beat 0.880 on this split.


The link loads the sample when the classification tool has it. Run is still required.
| Dataset | Random forest accuracy | Random forest macro F1 | Gradient boosting accuracy | Gradient boosting macro F1 | Test rows |
|---|---|---|---|---|---|
| Iris Flowers | 0.921 | 0.923 | 0.947 | 0.949 | 38 |
| Wine (UCI wine recognition) | 1.000 | 1.000 | 1.000 | 1.000 | 45 |
| Customer Segments | 0.900 | 0.899 | 0.880 | 0.879 | 50 |
A new row is labeled by the fitted random forest or the fitted gradient boosting.
Random forest averages many trees grown on bootstrap samples. Gradient boosting adds trees of depth 3 that correct the remaining error. These runs use learning rate 0.1, and the published score is hold-out accuracy on a stratified 25% split.
Method: StandardScaler, drop constant columns. Comparison code version 8fbe69461da4 (scripts/seo/build_compare_runs.py). scikit-learn 1.4.2. Seed 42. Random forest and gradient boosting were fit on 2026-11-12. The class column is the training target. Scores are the stratified 25% hold-out. The shared run applies StandardScaler, and a tree split does not use that scale. Iris Flowers: UCI Machine Learning Repository, Iris (Fisher, 1936). License: CC BY 4.0. Wine (UCI wine recognition): UCI Machine Learning Repository, wine recognition. License: CC BY 4.0. Customer Segments: Synthetic customer records bundled with this site. License: Generated for demos; no external license.
Results computed, published, and last updated on 2026-11-12.
The comparison sentences are filled from these published runs by a fixed template, so the scores can be checked against the same datasets in the tool.
Maintainer: nikolaou1982.
Contact: nick1982100@gmail.com.