How does pruning reduce overfitting in Decision Trees?

Updated May 16, 2026

Short answer

Pruning removes unnecessary branches that do not improve generalization, reducing model complexity.

Deep explanation

Pruning works by penalizing overly complex trees. In cost-complexity pruning (used in CART), a penalty term α * number_of_leaves is added to the loss function. The algorithm finds subtrees that minimize both impurity and complexity. This prevents the model from fitting noise in training data and improves generalization performance.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Decision Trees interview questions

View all →