Post

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

TermMeaning
πŸ”΅ Node (Vertex)A point in the tree
βž– EdgeConnection between nodes
πŸ‘¨ ParentNode with children
πŸ‘Ά ChildNode below parent
πŸ‘₯ SiblingsNodes with same parent
🌳 RootTop node
πŸƒ LeafNode with no children
⬆ AncestorAny node above
⬇ DescendantAny node below
🌿 SubtreeTree 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

  1. Choose best feature & split value
  2. Divide feature space
  3. Repeat recursively
  4. 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

MethodIdea
🎲 BaggingReduce variance
🌲 Random ForestRandomized bagging
πŸš€ BoostingReduce bias sequentially

➑ Dramatically improves accuracy


5️⃣ Model Flexibility vs Interpretability

ModelFlexibilityInterpretability
Linear ModelsLowHigh
Decision TreesMediumMedium
Random Forest / BoostingHighLow
Deep LearningVery HighVery 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.