Decision tree
- Splits
- gini.
- Features
- All columns.
- Depth
- Unlimited.
Loading…
A decision tree cuts the table with one tree. A random forest averages many trees grown on bootstrap samples. These runs use gini splits, and the published score is hold-out accuracy on a stratified 25% split.
Is one tree enough?
One gini tree, or a vote of bagged trees.
Random forest has the higher hold-out accuracy on Iris Flowers, Wine (UCI wine recognition), and Customer Segments.
Choose the score the table needs.
This is a choice, not a measured winner.
On Iris Flowers (150 rows, 4 features), one decision tree with gini splits and no depth limit reaches hold-out accuracy 0.895 and macro F1 0.897 on 38 test rows. Random forest grows 100 bagged trees with sqrt features at each split 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. Random forest has the higher hold-out accuracy 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), one decision tree with gini splits and no depth limit reaches hold-out accuracy 0.956 and macro F1 0.956 on 45 test rows. Random forest grows 100 bagged trees with sqrt features at each split 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. Random forest has the higher hold-out accuracy 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), one decision tree with gini splits and no depth limit reaches hold-out accuracy 0.820 and macro F1 0.819 on 50 test rows. Random forest grows 100 bagged trees with sqrt features at each split and reaches accuracy 0.900 and macro F1 0.899 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.


The link loads the sample when the classification tool has it. Run is still required.
The single tree has no depth limit. The forest is 100 bootstrap trees, and each split sees a random subset of features, sqrt of the column count. That is why the forest is higher on Iris, Wine, and Customer Segments.
| Dataset | Decision tree accuracy | Decision tree macro F1 | Random forest accuracy | Random forest macro F1 | Test rows |
|---|---|---|---|---|---|
| Iris Flowers | 0.895 | 0.897 | 0.921 | 0.923 | 38 |
| Wine (UCI wine recognition) | 0.956 | 0.956 | 1.000 | 1.000 | 45 |
| Customer Segments | 0.820 | 0.819 | 0.900 | 0.899 | 50 |
A new row is labeled by the fitted decision tree or the fitted random forest.
A decision tree cuts the table with one tree. A random forest averages many trees grown on bootstrap samples. These runs use gini splits, 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. Decision tree and random forest 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.