Decision Tree
Decision Tree
The name itself suggests that it uses a flowchart like a tree structure to show
the predictions that result from a series of feature-based splits. It starts with a
root node and ends with a decision made by leaves.
Terminologies used in Decision Trees
Root Node: The initial node at the beginning of a decision tree, where the
entire population or dataset starts dividing based on various features or
conditions.
Decision Nodes: Nodes resulting from the splitting of root nodes are
known as decision nodes. These nodes represent intermediate decisions or
conditions within the tree.
Leaf Nodes: Nodes where further splitting is not possible, often indicating
the final classification or outcome. Leaf nodes are also referred to as terminal
nodes.
Sub-Tree: Similar to a subsection of a graph being called a sub-graph, a
sub-section of a decision tree is referred to as a sub-tree. It represents a
specific portion of the decision tree.
Pruning: The process of removing or cutting down specific nodes in a
decision tree to prevent overfitting and simplify the model.
Branch / Sub-Tree: A subsection of the entire decision tree is referred to
as a branch or sub-tree. It represents a specific path of decisions and outcomes
within the tree.
Parent and Child Node: In a decision tree, a node that is divided into sub-
nodes is known as a parent node, and the sub-nodes emerging from it are
referred to as child nodes. The parent node represents a decision or condition,
while the child nodes represent the potential outcomes or further decisions
based on that condition.
Example of Decision Tree
Let’s understand decision trees with the help of an example:
In the below diagram the tree will first ask what is the weather? Is it sunny,
cloudy, or rainy? If yes then it will go to the next feature which is humidity
and wind. It will again check if there is a strong wind or weak, if it’s a weak
wind and it’s rainy then the person may go and play.