A binary classification training set has 64 one-dimensional samples, 32 from each class, and all 64 values of x are distinct. A decision tree splits with thresholds x≤θ 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 x 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 d holds at most 64−d 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

  1. 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.
  2. (a) 100%. Sort the points by x and put a threshold between every pair of neighbours with different labels; every interval is then pure. This needs distinct x values, since two samples with the same x but different labels can never be separated.
  3. (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 d has at most 64−d samples. A leaf needs at least one sample, so depth ≤63. This is reached when the labels alternate along x 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.
  4. (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.
  5. Add a useful contrast. With alternating labels the tree needs 64 pure leaves, and a tree of depth d has at most 2d leaves, so even the best tree for that data has depth at least log⁡264=6. A balanced tree reaches 6.
  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

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 f1 and f2 are combined as y^=wf1(x)+(1−w)f2(x). Assume both are unbiased, their errors e1=f1(x)−y and e2=f2(x)−y have variances σ12 and σ22, and Cov⁡(e1,e2)=ρσ1σ2, where ρ is the correlation of the errors. Which w 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 yi∈{−1,+1}, and when and why must a weak classifier be rejected, in terms of its weight αt?