Random forest
- Trees
- 100.
- Features
- sqrt.
- Depth
- Unlimited.
Loading…
Random forest averages many trees grown on bootstrap samples. XGBoost adds trees that correct the remaining error. These runs use 100 trees, 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; Hold-out accuracy is within 0.01 on Iris Flowers and Wine (UCI wine recognition).
Choose the score the table needs.
This is a choice, not a measured winner.
On Iris Flowers (150 rows, 4 features), Random forest grows 100 trees on bootstrap samples with sqrt features at each split and reaches hold-out accuracy 0.921 and macro F1 0.923 on 38 test rows. XGBoost grows 100 trees at learning rate 0.3 and depth 6 and reaches accuracy 0.921 and macro F1 0.923 on the same 38 rows. The pictures place those hold-out rows on a PCA plane fit to the scaled table and color them by the prediction. 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.
On Wine (UCI wine recognition) (178 rows, 13 features), Random forest grows 100 trees on bootstrap samples with sqrt features at each split and reaches hold-out accuracy 1.000 and macro F1 1.000 on 45 test rows. XGBoost grows 100 trees at learning rate 0.3 and depth 6 and reaches accuracy 1.000 and macro F1 1.000 on the same 45 rows. The pictures place those hold-out rows on a PCA plane fit to the scaled table and color them by the prediction. 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.
On Customer Segments (200 rows, 5 features), Random forest grows 100 trees on bootstrap samples with sqrt features at each split and reaches hold-out accuracy 0.900 and macro F1 0.899 on 50 test rows. XGBoost grows 100 trees at learning rate 0.3 and depth 6 and reaches accuracy 0.860 and macro F1 0.858 on the same 50 rows. The pictures place those hold-out rows on a PCA plane fit to the scaled table and color them by the prediction. 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.
XGBoost used 100 trees, depth 6, and learning rate 0.3, with no early stopping, on about 150 training rows. Random forest used bagged trees. That is why 0.900 beat 0.860 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 | XGBoost accuracy | XGBoost macro F1 | Test rows |
|---|---|---|---|---|---|
| Iris Flowers | 0.921 | 0.923 | 0.921 | 0.923 | 38 |
| Wine (UCI wine recognition) | 1.000 | 1.000 | 1.000 | 1.000 | 45 |
| Customer Segments | 0.900 | 0.899 | 0.860 | 0.858 | 50 |
A new row is labeled by the fitted random forest or the fitted XGBoost.
Random forest averages many trees grown on bootstrap samples. XGBoost adds trees that correct the remaining error. These runs use 100 trees, 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. XGBoost 2.1.4. Seed 42. Random forest and XGBoost 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.