Decision Tree Nodes
Every Decision Tree is made up of different types of nodes, each playing a distinct role in how the tree makes its final prediction.
Types of Nodes
Root Node: The topmost node, representing the entire dataset before any split
Internal Node: A node that splits the data further based on a feature test
Leaf Node: A terminal node that assigns the final class label (no further splits)
How Splitting Happens at Each Node
At every internal node, the algorithm evaluates possible splits across all features and picks the one that most reduces impurity in the resulting child nodes.
Depth and Node Count
The depth of a tree refers to the number of levels from the root to the deepest leaf - deeper trees have more nodes and can capture more complex patterns, but at a higher risk of overfitting.
Pruning - removing branches that provide little predictive power - is a common technique to reduce the number of nodes and improve generalization.
Coming Up Next
Next, you'll learn about Discretization, a technique for converting continuous variables into discrete bins.