A binary classification training set has 64 one-dimensional samples, 32 from each class, and all 64 values of are distinct. A decision tree splits with thresholds and keeps splitting until every leaf is pure. Justify each answer. (a) What is the maximum possible training accuracy? (b) What is the maximum possible depth of the tree? (c) What is the minimum possible depth? (d) Does the minimum-depth tree need regularisation?
Supervised learning, Decision trees
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you can reason about what threshold splits can do in one dimension, and bound the depth by counting samples per node.
Key idea
With distinct values, any labelling can be fitted, so training accuracy can reach 100%. Every split sends at least one sample to each side, so a node at depth holds at most samples; the deepest possible tree therefore has depth 63. The shallowest is a single split (depth 1), which is possible only when one threshold separates the two classes.
Steps
- Fix the convention first, because the answers depend on it: the root has depth 0, and the depth of the tree is the number of splits on its longest root-to-leaf path.
- (a) 100%. Sort the points by and put a threshold between every pair of neighbours with different labels; every interval is then pure. This needs distinct values, since two samples with the same but different labels can never be separated.
- (b) 63. Each split leaves at least one sample in each child, so each step down removes at least one sample: a node at depth has at most samples. A leaf needs at least one sample, so depth . This is reached when the labels alternate along and each split cuts off just one end point. Every remaining node stays mixed, so you get a chain of 63 splits and 64 leaves.
- (c) 1. If all 32 samples of one class lie below all 32 of the other, one threshold gives two pure leaves. Depth 0 (a single leaf) is impossible, because a leaf holding both classes is only 50% accurate.
- Add a useful contrast. With alternating labels the tree needs 64 pure leaves, and a tree of depth has at most leaves, so even the best tree for that data has depth at least . A balanced tree reaches 6.
- (d) No. A depth-1 tree (a stump) is the simplest tree that is not a constant. Regularisation, such as a maximum depth, a minimum number of samples per leaf, or pruning, exists to reduce the variance of deep trees. The stump's 100% training accuracy comes from the data being separable by one threshold, not from memorising noise.
Common mistakes
- Answering 32 or 6 for the maximum depth. 6 is the minimum depth for the worst labelling, not the maximum depth over all trees.
- Not stating the depth convention. If the root counts as depth 1, the answers become 64 and 2.
- Forgetting the distinct- assumption in (a).
- Answering “yes, always regularise” in (d) without noticing how simple the stump already is.
How long your answer should be
Four short, justified answers; about half a page.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: Two regression models and are combined as . Assume both are unbiased, their errors and have variances and , and , where is the correlation of the errors. Which minimises the variance of the combined error, and what is that minimum variance?
Next in Supervised learning: What is the AdaBoost algorithm for binary labels , and when and why must a weak classifier be rejected, in terms of its weight ?