Doubt about leaf node concept

Please explain this leaf node concept like how the decision tree is terminated.

Hey @Varunsh_20

A leaf node is basically a class label. When traversing the tree for a query sample, whenever we reach a leaf node, we stop our search and assign the label stored in the leaf node to the data sample.

The decision to stop building the tree and make a leaf node is dependent on many criteria. A few of them:

  1. All the samples of the data partition belong to the same class. (Assign that class to the leaf node).
  2. Less than a threshold, too few or no data samples are present for further partitioning (Assign the majority class to the leaf node. Generally done to prevent over-fitting).
  3. Any other custom / hard-coded logic.

Hope this helps!