Decision Trees
Decision Trees
π³ Decision Trees
Decision trees are intuitive, interpretable models that split the feature space into simple regions.
1οΈβ£ Tree Terminology Review
π² General Tree Structure
A general tree T is partitioned into:
- Root node r
- A set of subtrees attached to the root
Example structure:
1
2
3
4
5
A (root)
/ \
B C
/|\
D E F
π Basic Terminology
| Term | Meaning |
|---|---|
| π΅ Node (Vertex) | A point in the tree |
| β Edge | Connection between nodes |
| π¨ Parent | Node with children |
| πΆ Child | Node below parent |
| π₯ Siblings | Nodes with same parent |
| π³ Root | Top node |
| π Leaf | Node with no children |
| β¬ Ancestor | Any node above |
| β¬ Descendant | Any node below |
| πΏ Subtree | Tree inside tree |
2οΈβ£ Tree-Based Learning
π― Core Idea
Tree-based learning segments the predictor space into simple regions.
β Recursive partitioning
β Forms decision rules
β Works for both:
- π Regression
- π Classification
βοΈ How It Works
- Choose best feature & split value
- Divide feature space
- Repeat recursively
- Leaf β prediction
π Interpretation
- Space split into rectangular regions
- Prediction is constant inside each region
- Model behaves like a step function
3οΈβ£ Introduction to Decision Trees
β Pros
- π§ Easy to interpret
- π Transparent decision rules
- βοΈ No feature scaling required
- π Handles nonlinear relationships
- π Works with mixed data types
β Cons
- π Often lower prediction accuracy
- β οΈ High variance (unstable)
- πͺ Prone to overfitting
4οΈβ£ Ensemble Methods π²π²π²
Multiple trees β Stronger model
| Method | Idea |
|---|---|
| π² Bagging | Reduce variance |
| π² Random Forest | Randomized bagging |
| π Boosting | Reduce bias sequentially |
β‘ Dramatically improves accuracy
5οΈβ£ Model Flexibility vs Interpretability
| Model | Flexibility | Interpretability |
|---|---|---|
| Linear Models | Low | High |
| Decision Trees | Medium | Medium |
| Random Forest / Boosting | High | Low |
| Deep Learning | Very High | Very Low |
π§ Key Insights
- Decision trees partition feature space
- Produce interpretable rules
- Single tree β simple but weak
- Many trees β powerful model
π One-Line Summary
Decision Trees split the feature space into simple regions to form interpretable decision rules π³
This post is licensed under CC BY 4.0 by the author.