How CART Builds a Tree (Step-by-Step)
CART builds the decision tree using a top-down recursive approach:
- Start with the complete dataset at the root node.
- Evaluate all possible splits using Gini Index (for classification).
- Select the split with the minimum Gini impurity.
- Split the dataset into two child nodes.
- Repeat the process for each child node.
- Stop when nodes become pure or no further splitting is possible.
Small Example
Suppose we are predicting whether a student will play cricket:
If Performance ≥ Average → go left
Else → go right
CART keeps dividing data in this way until a clear decision can be made.
