NEW
Technique that removes weak branches from decision trees to reduce complexity and overfitting.
DESCRIPTION
Pruning simplifies decision trees by cutting branches that contribute little to predictive power, improving generalization and interpretability. Post-pruning methods evaluate subtrees on validation data and remove those increasing error. Cost-complexity pruning (alpha pruning) trades off depth against impurity to avoid overfitting. Pre-pruning stops growth early using constraints like max depth, min samples, or significance tests. Proper pruning balances bias and variance, often guided by cross-validation. It is widely implemented in CART-based algorithms and toolkits like scikit-learn and rpart.
ALTERNATIVE DEFINITIONS
Wikipedia
Pruning is a technique in machine learning that reduces the size of decision trees by removing sections of the tree that provide little power to classify instances.
Focuses on classification power and tree size reduction.
scikit-learn
Minimal cost-complexity pruning is an algorithm to prune a tree to avoid overfitting.
Emphasizes the specific cost-complexity approach to pruning.
RELATED TERMS
Decision Tree Model Overfitting Cost-Complexity Pruning Cross-Validation Random Forest Classification and Regression Trees Entropy Gini Impurity
COMPETING TERMS
Early Stopping Regularization
RELATIONS
- Narrower: Alpha-Beta Pruning Cost-Complexity Pruning Model Pruning Partition Pruning Reduced Error Pruning
KNOWLEDGE AREAS
AI Data Science Mathematics Testing & Validation
TARGET AUDIENCE
Data Scientist AI Engineer MLOps Engineer
EXTERNAL SOURCES
- Wikipedia - Pruning (decision trees)
- scikit-learn - User guide on cost-complexity pruning
- Oracle - Decision tree growth and pruning concepts
- IBM - SPSS Modeler tree pruning documentation
TOP QUESTIONS
Why is Pruning important for decision trees?
Pruning reduces overfitting by removing branches that model noise. This typically improves generalization, stabilizes predictions, and enhances interpretability for stakeholders.
Category: Relevancy
What is cost-complexity pruning in Pruning?
It introduces a penalty for tree size, selecting the subtree that minimizes impurity plus a complexity term. Cross-validation often determines the optimal penalty parameter.
Category: Example
What is a common mistake in Pruning?
Over-pruning can increase bias and hurt accuracy. Always validate pruning choices with held-out data or cross-validation to balance bias and variance.
Category: Mistakes
How does Pruning differ from Early Stopping?
Early stopping halts growth based on constraints, while pruning removes branches after full growth. Post-pruning often yields better models than hard growth limits.
Category: Alternatives
How is Pruning parameterized in practice?
Common parameters include alpha for cost-complexity, minimum samples per leaf, and maximum depth. These are tuned using validation data or grid search.
Category: Requirements
Does Pruning help interpretability?
Yes. Simpler pruned trees are easier to explain, highlighting the most influential splits and reducing cognitive load for business audiences.
Category: Opinion
How does Pruning affect Random Forests?
Random forests usually grow deep trees and control overfitting via bagging and feature randomness. Explicit pruning is less common but can be applied case-by-case.
Category: Application
When should I avoid Pruning?
If the tree is already shallow or regularized by constraints, pruning may yield little benefit and may increase bias, harming performance.
Category: Risk
How do I evaluate Pruning effectiveness?
Compare validation metrics before and after pruning, and inspect learning curves. Use cross-validation to ensure robustness across folds.
Category: Testing