Evaluating the Effect of Tree Depth on the Performance of Decision Tree Classifiers

The maximum depth of a decision tree is one of the most influential hyperparameters governing the trade-off between model bias and variance. A tree that is too shallow may fail to capture the underlying structure of the data (underfitting), whereas a tree that is too deep tends to memorize training examples, harming its ability to generalize (overfitting). This paper presents a systematic empirical evaluation of the effect of maximum tree depth on classification performance using the CART-based DecisionTreeClassifier implementation from scikit-learn. Experiments are conducted on two widely used benchmark datasets — the Breast Cancer Wisconsin (Diagnostic) dataset and the Wine dataset — with depth values ranging from 1 to 20. For each depth, we report training accuracy, held-out test accuracy, and 5-fold stratified cross-validation accuracy, alongside structural complexity metrics such as the number of leaves and total nodes. Results show that test accuracy rises sharply for shallow trees, peaks at a moderate depth, and then plateaus or slightly declines as depth increases further, while training accuracy converges to a perfect fit. On the Breast Cancer dataset, cross-validation accuracy peaked at a depth of five, while training accuracy reached 100% by depth six, clearly illustrating the onset of overfitting. These findings reinforce the practical guidance that tree depth should be tuned via cross-validation rather than fixed a priori, and that pruning or depth-limiting strategies are essential for building decision trees that generalize well.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-09-12
DOI
https://doi.org/10.5281/zenodo.22714665
Primary Topic
Explainable Artificial Intelligence (XAI)
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
preprint

Evaluating the Effect of Tree Depth on the Performance of Decision Tree Classifiers

Yazdan Yasami
Zenodo (CERN European Organization for Nuclear Research)
Explainable Artificial Intelligence (XAI)
preprint

Evaluating the Effect of Tree Depth on the Performance of Decision Tree Classifiers

Yazdan Yasami
preprint en

Abstract

The maximum depth of a decision tree is one of the most influential hyperparameters governing the trade-off between model bias and variance. A tree that is too shallow may fail to capture the underlying structure of the data (underfitting), whereas a tree that is too deep tends to memorize training examples, harming its ability to generalize (overfitting). This paper presents a systematic empirical evaluation of the effect of maximum tree depth on classification performance using the CART-based DecisionTreeClassifier implementation from scikit-learn. Experiments are conducted on two widely used benchmark datasets — the Breast Cancer Wisconsin (Diagnostic) dataset and the Wine dataset — with depth values ranging from 1 to 20. For each depth, we report training accuracy, held-out test accuracy, and 5-fold stratified cross-validation accuracy, alongside structural complexity metrics such as the number of leaves and total nodes. Results show that test accuracy rises sharply for shallow trees, peaks at a moderate depth, and then plateaus or slightly declines as depth increases further, while training accuracy converges to a perfect fit. On the Breast Cancer dataset, cross-validation accuracy peaked at a depth of five, while training accuracy reached 100% by depth six, clearly illustrating the onset of overfitting. These findings reinforce the practical guidance that tree depth should be tuned via cross-validation rather than fixed a priori, and that pruning or depth-limiting strategies are essential for building decision trees that generalize well.

Zenodo (CERN European Organization for Nuclear Research)
Peace, Justice and strong institutions
Explainable Artificial Intelligence (XAI)
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Evaluating the Effect of Tree Depth on the Performance of Decision Tree Classifiers — Yazdan Yasami · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS