Decision Tree Pruning¶
A model-simplification method — instantiates Search Space Pruning
Cuts branches out of a fitted model when held-out data shows they capture noise rather than signal — shrinking the model toward the size that generalizes best, not the size that fits training data best.
Decision Tree Pruning narrows a different kind of space: the branches of an already-grown predictive model. A tree left to grow until it perfectly classifies its training data has learned the noise along with the signal — it overfits. Pruning removes the branches whose extra splits improve fit on the data the tree was grown from but not on data it has never seen. Its defining instrument is the held-out sample: the keep/cut decision is judged against a validation set, so "does this branch earn its place?" means "does it help on unseen cases?", not "does it reduce training error?" That reliance on out-of-sample evidence is what separates it from every sibling that prunes options — here the candidates being pruned are parts of a model, and the success criterion is generalization.
Example¶
A bank grows a decision tree to flag loan applications likely to default. Grown to full depth, it splits down to leaves like "self-employed, applied on a Tuesday, ZIP starts with 4" — rules that perfectly separate the training loans but describe coincidences, not risk. On a held-out set of loans the tree never saw, that fully-grown tree scores worse than a smaller one, because those deep splits are noise.
Cost-complexity pruning weighs each subtree's contribution against a penalty for its size and snips the branches whose accuracy gain vanishes on the validation set. The tree shrinks from ~300 leaves to ~40. Training accuracy drops slightly — the model no longer memorizes every past loan — but held-out accuracy rises, and the surviving rules (debt-to-income, payment history) are ones an underwriter can defend. The pruned branches were removed not because they were wrong on paper but because they did not survive contact with unseen data.
How it works¶
- Grow first, then cut — build a deliberately over-large tree, then remove branches (post-pruning), rather than stopping growth early and possibly missing real structure.
- Define the success criterion as generalization — score candidate subtrees by performance on held-out data, adjusted for complexity, not by training fit.
- Rank branches by marginal value — identify the splits whose removal costs little or no held-out accuracy.
- Prune to the sweet spot — cut branches until further removal would start hurting out-of-sample performance.
The distinctive move is that the pruning evidence lives outside the data used to build the model — the holdout is the referee.
Tuning parameters¶
- Complexity penalty (e.g. the cost-complexity α) — how heavily tree size is penalized. Higher prunes more aggressively toward a small, general model; too high underfits and discards real signal.
- Validation scheme — a single held-out set versus cross-validation; the latter estimates the sweet spot more stably at more compute.
- Success metric — accuracy, calibrated probability, cost-weighted error; the choice reshapes which branches count as earning their keep.
- Pre- vs. post-pruning — stopping growth early is cheap but can miss structure that only pays off a few splits deeper; grow-then-cut is safer and costlier.
- Minimum leaf support — the fewest cases a leaf may cover; raising it prunes fragile, low-support rules that generalize poorly.
When it helps, and when it misleads¶
Its strength is turning a memorizing model into a generalizing one, and doing it on evidence: the holdout makes "this branch is just noise" a checkable claim, and the smaller tree is usually more accurate on new cases and far easier to explain.
It misleads when the holdout is not representative of where the model will be used — prune against a validation set drawn from the wrong distribution and you optimize for the wrong world, cutting branches that would have mattered in production.[1] Over-aggressive penalties underfit, erasing genuine structure; and pruning purely for a tidy, presentable tree — rather than for held-out performance — quietly trades accuracy for looks. The discipline is to keep the validation data honestly representative and untouched by model-building, and to let out-of-sample performance, not model tidiness, set the stopping point.
How it implements the components¶
objective_or_success_criterion— it makes the success criterion explicit and shifts it from training fit to generalization, so branches are judged on unseen-data value.candidate_or_region_representation— the prunable unit is a branch/subtree of the model; each can be kept, cut, or (by regrowing) reconsidered.representative_sample_holdout— the held-out set is the referee for every cut, and keeping it representative is the method's central safeguard.
It does not apply external hard constraints (Constraint Filtering) or prove formal dominance (Branch and Bound); its "dominance" is empirical marginal value measured on the holdout, and it carries no reentry or ownership machinery.
Related¶
- Instantiates: Search Space Pruning — Decision Tree Pruning applies the archetype inside a model, pruning branches instead of options.
- Consumes: a labeled held-out sample, on which every keep/cut decision depends.
- Sibling mechanisms: Sample Audit of Exclusions · Branch and Bound · Beam Search · Constraint Filtering · Dominated-Option Removal · Eligibility Screening · Negative Keyword Filter · Red-Flag Screen · Safety or Compliance Exclusion · Shortlisting · Triage Filter
References¶
[1] Overfitting is fitting the idiosyncratic noise of a training sample rather than the underlying pattern, so accuracy on new data falls. Pruning is a bias–variance trade: removing branches raises bias a little to cut variance a lot, which is why the held-out (not training) score is the right referee. ↩