Tree Terminology: Nodes, Edges, and Leaves
You'll learn the essential vocabulary for describing the anatomy of decision trees, from root to leaves.
The Tree Anatomy
A decision tree is built from distinct structural components, each with a precise name. Understanding this terminology is crucial for discussing how trees make decisions.
Root node: The topmost node where every prediction starts. It represents the entire dataset before any splits occur. Think of it as the tree's starting question.
Internal nodes (or decision nodes): Nodes that contain a splitting condition—a test on a feature. Each internal node asks a question (like "Is age > 30?") and has two or more children. These are the decision points in your tree.
Edges (or branches): The connections between nodes. Each edge represents the outcome of a decision. For example, one edge might represent "yes" and another "no" from a binary split.
Leaf nodes (or terminal nodes): Nodes at the bottom of the tree with no children. These contain the final predictions—either a class label (for classification) or a numerical value (for regression). Once you reach a leaf, the tree has made its decision.
Parent and child: A parent node splits into child nodes via edges. The root has no parent; leaves have no children.
Why This Matters
When you traverse a decision tree to make a prediction, you start at the root, follow edges based on feature tests at internal nodes, and stop at a leaf node where the prediction lives. Each data point takes exactly one path from root to leaf.
Key Takeaway: Decision trees are hierarchical structures where the root begins the decision process, internal nodes ask questions connected by edges, and leaves provide final predictions—this vocabulary is foundational for understanding tree algorithms.