Decision Tree
Dr. Marwa M. Emam
Faculty of computers and Information
Minia University
Dr. Marwa M. Emam 1
Agenda
 Introduction to Decision Trees
 Basic Structure of Decision Trees
 Decision Tree Components
 How Decision Trees Work
 Splitting Criteria
 Advantages of Decision Trees
 Challenges and Limitations
Dr. Marwa M. Emam 2
Decision Tree
 A decision tree is a popular machine learning algorithm used for both
classification and regression tasks.
 Decision trees are trained with labeled data, where the labels that we want
to predict can be classes (for classification) or values (for regression).
 It models decisions based on a series of questions or conditions and their
possible outcomes.
 The structure of a decision tree resembles an inverted tree, where each
internal node represents a decision or test, each branch represents an
outcome of that decision, and each leaf node represents the final decision or
classification.
Dr. Marwa M. Emam
3
Decision Tree …
 Decision tree is a un directed graph/tree where:
 Each internal node correspond to attributes (Features).
 Leafs correspond to classification outcomes.
 Edge denotes assignment.
 Root: The most dominant attribute.
Dr. Marwa M. Emam 4
Decision Tree …
 Classification trees :
 Tree models where the target variable can take a discrete set of values are
called classification trees. In these tree structures, leaves represent class
labels and branches represent conjunctions of features that lead to those
class labels.
 Regression trees :
 Decision trees where the target variable can take continuous values (real
numbers) like the price of a house, or a patient’s length of stay in a
hospital, are called regression trees.
Dr. Marwa M. Emam 5
Classification Tree:
 Nodes in the classification tree are identified by the feature
names of the given data.
 Branches in the tree are identified by the values of features.
 The leaf nodes identified by are the class labels.
Dr. Marwa M. Emam 6
Decision Tree Structure
Dr. Marwa M. Emam 7
 Decision tree A machine learning model based on yes-or-no questions and
represented by a binary tree. The tree has a root node, decision nodes, leaf nodes,
and branches.
 root node The topmost node of the tree. It contains the first yes-or-no question. For
convenience, we refer to it as the root.
 decision node Each yes-or-no question in our model is represented by a decision
node, with two branches emanating from it (one for the “yes” answer, and one for
the “no” answer).
 leaf node A node that has no branches emanating from it. These represent the
decisions we make after traversing the tree. For convenience, we refer to them as
leaves.
 branch The two edges emanating from each decision node, corresponding to the
“yes” and “no” answers to the question in the node.
Dr. Marwa M. Emam
8
Problem
Dr. Marwa M. Emam 9
Problem….
Dr. Marwa M. Emam 10
How to build the tree ? Choose the root
node??
Dr. Marwa M. Emam 11
How to build the tree ? Choose the root
node??
 In decision tree algorithms, entropy and information gain are concepts used to
determine the best feature to split the data at each internal node.
 Entropy is a measure of disorder or impurity in a set of data. In the context of
decision trees, entropy is used to quantify the homogeneity (or heterogeneity) of
a group of samples with respect to their class labels.
 E(S)= 𝑷𝟏 𝐥𝐨𝐠𝟐( 𝑷𝟏 ) - 𝑷𝟐 𝒍𝒐𝒈𝟐(𝑷𝟐)
 Where 𝑷𝟏 , 𝑷𝟐 are the proportions of samples belonging to the two classes.
Dr. Marwa M. Emam
12
How to build the tree ? Choose the root
node??
 In decision tree algorithms, entropy and information gain are concepts used to
determine the best feature to split the data at each internal node.
 Entropy is a measure of disorder or impurity in a set of data. In the context of
decision trees, entropy is used to quantify the homogeneity (or heterogeneity) of
a group of samples with respect to their class labels.
 E(S)= 𝑷𝟏 𝐥𝐨𝐠𝟐( 𝑷𝟏 ) - 𝑷𝟐 𝒍𝒐𝒈𝟐(𝑷𝟐)
 Where 𝑷𝟏 , 𝑷𝟐 are the proportions of samples belonging to the two classes.
Dr. Marwa M. Emam
13
How to build the tree ? Choose the
root node??
 Information Gain is a metric used to determine the effectiveness of
a feature in reducing entropy. The goal is to select the feature that
results in the highest information gain when splitting the data.
 G(S, A)= E(S) -
|𝑺𝒗|
|𝑺|
E(𝑺𝒗)
 Where S is the dataset (original). A is the feature being considered
for splitting. 𝑺𝒗 represents the subset of S for which feature A has
value 𝒗. E is the entropy.
Dr. Marwa M. Emam 14
Example:
Dr. Marwa M. Emam 15
Dr. Marwa M. Emam
16
Dr. Marwa M. Emam
17
Dr. Marwa M. Emam
18
Dr. Marwa M. Emam 19
Dr. Marwa M. Emam
20
Dr. Marwa M. Emam 21
Dr. Marwa M. Emam 22
Dr. Marwa M. Emam 23
Dr. Marwa M. Emam 24
Dr. Marwa M. Emam 25
Algorithm ID3
Dr. Marwa M. Emam 26
Dr. Marwa M. Emam 27
Task
Thanks
Dr. Marwa M. Emam 29

More Related Content

PPTX
Decision Tree Classification Algorithm.pptx
PDF
decision tree and random forest in AIML for CSE
PPT
Decision tree and random forest
PDF
Decision Tree-ID3,C4.5,CART,Regression Tree
PPTX
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
PPTX
Decision tree presentation
PDF
7 decision tree
PDF
Data Science Machine LearningClassification.pdf
Decision Tree Classification Algorithm.pptx
decision tree and random forest in AIML for CSE
Decision tree and random forest
Decision Tree-ID3,C4.5,CART,Regression Tree
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision tree presentation
7 decision tree
Data Science Machine LearningClassification.pdf

Similar to Machine Learning-Lec6 expalin the decision .pdf (20)

PPTX
Decision Tree.pptx
PPTX
Model 4 Lecture notes , tutorial notes with easy concepts
PDF
CSA 3702 machine learning module 2
PPTX
Decision_Tree_Presentation_with_indepth_analysis.pptx
PPTX
Ai & Machine learning - 31140523010 - BDS302.pptx
PDF
Decision trees
PDF
Understanding Decision Trees in Machine Learning: A Comprehensive Guide
PPTX
Data Science-entropy machine learning.pptx
PPTX
ML-Lecture06_07.pptxxxx bjkf mlllllllllll
PDF
Machine Learning Unit-5 Decesion Trees & Random Forest.pdf
PPTX
DECESION TREE and -SVM-NAIVEs bayes-BAYS.pptx
PPTX
Pokli Machine-Learning-Decision-Trees.pptx
DOCX
Classification Using Decision Trees and RulesChapter 5.docx
PPTX
Lect9 Decision tree
PDF
Decision treeDecision treeDecision treeDecision tree
PDF
Aiml ajsjdjcjcjcjfjfjModule4_Pashrt1-1.pdf
PPTX
decision tree DECISION TREE IN MACHINE .pptx
PDF
lec8_annotated.pdf ml csci 567 vatsal sharan
PPTX
Decision tree
PDF
Decision Tree in Machine Learning
Decision Tree.pptx
Model 4 Lecture notes , tutorial notes with easy concepts
CSA 3702 machine learning module 2
Decision_Tree_Presentation_with_indepth_analysis.pptx
Ai & Machine learning - 31140523010 - BDS302.pptx
Decision trees
Understanding Decision Trees in Machine Learning: A Comprehensive Guide
Data Science-entropy machine learning.pptx
ML-Lecture06_07.pptxxxx bjkf mlllllllllll
Machine Learning Unit-5 Decesion Trees & Random Forest.pdf
DECESION TREE and -SVM-NAIVEs bayes-BAYS.pptx
Pokli Machine-Learning-Decision-Trees.pptx
Classification Using Decision Trees and RulesChapter 5.docx
Lect9 Decision tree
Decision treeDecision treeDecision treeDecision tree
Aiml ajsjdjcjcjcjfjfjModule4_Pashrt1-1.pdf
decision tree DECISION TREE IN MACHINE .pptx
lec8_annotated.pdf ml csci 567 vatsal sharan
Decision tree
Decision Tree in Machine Learning
Ad

More from BeshoyArnest (8)

PDF
ML_Lec1 introduction to machine learning.pdf
PDF
ML_Lec2 introduction to data processing.pdf
PDF
ML_Lec4 introduction to linear regression.pdf
PDF
Lec6,7,8 K-means, Niavebase, KNearstN.pdf
PDF
ML_Lec3 introduction to regression problems.pdf
PDF
Machine Learning-Lec7 Bayesian calssification.pdf
PDF
Machine Learning-Lec8 support vector machine.pdf
PDF
Machine Learning-Lec5.pdf_explain of logistic regression
ML_Lec1 introduction to machine learning.pdf
ML_Lec2 introduction to data processing.pdf
ML_Lec4 introduction to linear regression.pdf
Lec6,7,8 K-means, Niavebase, KNearstN.pdf
ML_Lec3 introduction to regression problems.pdf
Machine Learning-Lec7 Bayesian calssification.pdf
Machine Learning-Lec8 support vector machine.pdf
Machine Learning-Lec5.pdf_explain of logistic regression
Ad

Recently uploaded (20)

PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
observCloud-Native Containerability and monitoring.pptx
PPTX
The various Industrial Revolutions .pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
STKI Israel Market Study 2025 version august
PDF
Unlock new opportunities with location data.pdf
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
CloudStack 4.21: First Look Webinar slides
A contest of sentiment analysis: k-nearest neighbor versus neural network
observCloud-Native Containerability and monitoring.pptx
The various Industrial Revolutions .pptx
Assigned Numbers - 2025 - Bluetooth® Document
Hindi spoken digit analysis for native and non-native speakers
sustainability-14-14877-v2.pddhzftheheeeee
STKI Israel Market Study 2025 version august
Unlock new opportunities with location data.pdf
1 - Historical Antecedents, Social Consideration.pdf
Group 1 Presentation -Planning and Decision Making .pptx
Getting started with AI Agents and Multi-Agent Systems
O2C Customer Invoices to Receipt V15A.pptx
NewMind AI Weekly Chronicles – August ’25 Week III
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Zenith AI: Advanced Artificial Intelligence
Final SEM Unit 1 for mit wpu at pune .pptx
Taming the Chaos: How to Turn Unstructured Data into Decisions
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Module 1.ppt Iot fundamentals and Architecture
CloudStack 4.21: First Look Webinar slides

Machine Learning-Lec6 expalin the decision .pdf

  • 1. Decision Tree Dr. Marwa M. Emam Faculty of computers and Information Minia University Dr. Marwa M. Emam 1
  • 2. Agenda  Introduction to Decision Trees  Basic Structure of Decision Trees  Decision Tree Components  How Decision Trees Work  Splitting Criteria  Advantages of Decision Trees  Challenges and Limitations Dr. Marwa M. Emam 2
  • 3. Decision Tree  A decision tree is a popular machine learning algorithm used for both classification and regression tasks.  Decision trees are trained with labeled data, where the labels that we want to predict can be classes (for classification) or values (for regression).  It models decisions based on a series of questions or conditions and their possible outcomes.  The structure of a decision tree resembles an inverted tree, where each internal node represents a decision or test, each branch represents an outcome of that decision, and each leaf node represents the final decision or classification. Dr. Marwa M. Emam 3
  • 4. Decision Tree …  Decision tree is a un directed graph/tree where:  Each internal node correspond to attributes (Features).  Leafs correspond to classification outcomes.  Edge denotes assignment.  Root: The most dominant attribute. Dr. Marwa M. Emam 4
  • 5. Decision Tree …  Classification trees :  Tree models where the target variable can take a discrete set of values are called classification trees. In these tree structures, leaves represent class labels and branches represent conjunctions of features that lead to those class labels.  Regression trees :  Decision trees where the target variable can take continuous values (real numbers) like the price of a house, or a patient’s length of stay in a hospital, are called regression trees. Dr. Marwa M. Emam 5
  • 6. Classification Tree:  Nodes in the classification tree are identified by the feature names of the given data.  Branches in the tree are identified by the values of features.  The leaf nodes identified by are the class labels. Dr. Marwa M. Emam 6
  • 7. Decision Tree Structure Dr. Marwa M. Emam 7
  • 8.  Decision tree A machine learning model based on yes-or-no questions and represented by a binary tree. The tree has a root node, decision nodes, leaf nodes, and branches.  root node The topmost node of the tree. It contains the first yes-or-no question. For convenience, we refer to it as the root.  decision node Each yes-or-no question in our model is represented by a decision node, with two branches emanating from it (one for the “yes” answer, and one for the “no” answer).  leaf node A node that has no branches emanating from it. These represent the decisions we make after traversing the tree. For convenience, we refer to them as leaves.  branch The two edges emanating from each decision node, corresponding to the “yes” and “no” answers to the question in the node. Dr. Marwa M. Emam 8
  • 11. How to build the tree ? Choose the root node?? Dr. Marwa M. Emam 11
  • 12. How to build the tree ? Choose the root node??  In decision tree algorithms, entropy and information gain are concepts used to determine the best feature to split the data at each internal node.  Entropy is a measure of disorder or impurity in a set of data. In the context of decision trees, entropy is used to quantify the homogeneity (or heterogeneity) of a group of samples with respect to their class labels.  E(S)= 𝑷𝟏 𝐥𝐨𝐠𝟐( 𝑷𝟏 ) - 𝑷𝟐 𝒍𝒐𝒈𝟐(𝑷𝟐)  Where 𝑷𝟏 , 𝑷𝟐 are the proportions of samples belonging to the two classes. Dr. Marwa M. Emam 12
  • 13. How to build the tree ? Choose the root node??  In decision tree algorithms, entropy and information gain are concepts used to determine the best feature to split the data at each internal node.  Entropy is a measure of disorder or impurity in a set of data. In the context of decision trees, entropy is used to quantify the homogeneity (or heterogeneity) of a group of samples with respect to their class labels.  E(S)= 𝑷𝟏 𝐥𝐨𝐠𝟐( 𝑷𝟏 ) - 𝑷𝟐 𝒍𝒐𝒈𝟐(𝑷𝟐)  Where 𝑷𝟏 , 𝑷𝟐 are the proportions of samples belonging to the two classes. Dr. Marwa M. Emam 13
  • 14. How to build the tree ? Choose the root node??  Information Gain is a metric used to determine the effectiveness of a feature in reducing entropy. The goal is to select the feature that results in the highest information gain when splitting the data.  G(S, A)= E(S) - |𝑺𝒗| |𝑺| E(𝑺𝒗)  Where S is the dataset (original). A is the feature being considered for splitting. 𝑺𝒗 represents the subset of S for which feature A has value 𝒗. E is the entropy. Dr. Marwa M. Emam 14
  • 16. Dr. Marwa M. Emam 16
  • 17. Dr. Marwa M. Emam 17
  • 18. Dr. Marwa M. Emam 18
  • 19. Dr. Marwa M. Emam 19
  • 20. Dr. Marwa M. Emam 20
  • 21. Dr. Marwa M. Emam 21
  • 22. Dr. Marwa M. Emam 22
  • 23. Dr. Marwa M. Emam 23
  • 24. Dr. Marwa M. Emam 24
  • 25. Dr. Marwa M. Emam 25
  • 27. Dr. Marwa M. Emam 27
  • 28. Task