UNIT – III
DECISION TREE
1. Decision Tree / Building a decision tree / split algorithm based on
information theory / Split algorithm based Gini index
Decision tree is a simple diagram that shows different choices and their
possible results helping you make decisions easily.
A decision tree is a graphical representation of different options for solving a
problem and show how different factors are related.
It has a hierarchical tree structure starts with one main question at the top
called a node which further branches out into different possible outcomes where:
Root Node is the starting point that represents the entire dataset.
Branches: These are the lines that connect nodes. It shows the flow from one
decision to another.
Internal Nodes are Points where decisions are made based on the input
features.
Leaf Nodes: These are the terminal nodes at the end of branches that represent
final outcomes or predictions.
For Example
Imagine you want to decide whether to drink coffee based on the time of
day and how tired you feel. First the tree checks the time of day—if it’s morning
, it asks whether you are tired. If you’re tired the tree suggests drinking coffee if
not it says there’s no need. Similarly in the afternoon the tree again asks if you
are tired. If you recommends drinking coffee if not it concludes no coffee is
needed.
Classification of Decision Tree
There are two types of decision tree variable:
classification trees
Regression trees.
Classification trees:
They are designed to predict categorical outcomes mean they classify data
into different classes.
They can determine whether an email is “spam” or “not spam” based on
various features of the email.
Regression trees:
These are used when the target variable is continuous It predict numerical
values rather than categories.
For example a regression tree can estimate the price of a house based on its
size, location, and other features.
DECISION TREE
1. Decision Tree / Building a decision tree / split algorithm based on
information theory / Split algorithm based Gini index
Decision tree is a simple diagram that shows different choices and their
possible results helping you make decisions easily.
A decision tree is a graphical representation of different options for solving a
problem and show how different factors are related.
It has a hierarchical tree structure starts with one main question at the top
called a node which further branches out into different possible outcomes where:
Root Node is the starting point that represents the entire dataset.
Branches: These are the lines that connect nodes. It shows the flow from one
decision to another.
Internal Nodes are Points where decisions are made based on the input
features.
Leaf Nodes: These are the terminal nodes at the end of branches that represent
final outcomes or predictions.
For Example
Imagine you want to decide whether to drink coffee based on the time of
day and how tired you feel. First the tree checks the time of day—if it’s morning
, it asks whether you are tired. If you’re tired the tree suggests drinking coffee if
not it says there’s no need. Similarly in the afternoon the tree again asks if you
are tired. If you recommends drinking coffee if not it concludes no coffee is
needed.
Classification of Decision Tree
There are two types of decision tree variable:
classification trees
Regression trees.
Classification trees:
They are designed to predict categorical outcomes mean they classify data
into different classes.
They can determine whether an email is “spam” or “not spam” based on
various features of the email.
Regression trees:
These are used when the target variable is continuous It predict numerical
values rather than categories.
For example a regression tree can estimate the price of a house based on its
size, location, and other features.