How CART Builds a Tree (Step-by-Step)

How CART Builds a Tree (Step-by-Step)
CART builds the decision tree using a top-down recursive approach:

  1. Start with the complete dataset at the root node.
  2. Evaluate all possible splits using Gini Index (for classification).
  3. Select the split with the minimum Gini impurity.
  4. Split the dataset into two child nodes.
  5. Repeat the process for each child node.
  6. 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.