SlideShare a Scribd company logo
Decision Tree
Decision Tree
• Decision tree is a supervised machine
learning
technique, based on the divide and conquer paradigm.
• The basic idea behind decision trees is to partition the space
into patches and to fit a model to a patch.
• A decision tree is a tree structure, where each internal node
(non-leaf node) denotes a test on an attribute, each branch
represents an outcome of the test, and each leaf node (or
terminal node) holds a class label.
• A decision tree is a classifier expressed as a recursive partition
of the instance space.
• Decision trees are used for classification task.
Classification Problem in 2D view
Building Decision Tree
The core algorithm for building decision trees called ID3 employs a top-
down, greedy search through the space of possible branches with no
backtracking. ID3 uses Entropy and Information Gain to construct a
decision tree.
• The tree starts as a single node, N, representing the training records in
D.
• If the records in D are all of the same class, then node N becomes a
leaf and is labeled with that class.
• Otherwise, the algorithm calls Attribute selection method to determine
the splitting criterion. The splitting criterion tells us which attribute to
test at node N by determining the “best” way to separate or partition
the tuples in D into individual classes.
Entropy
Information Gain
• Information gain is Gain(D,A) for a set D is the effective change
in entropy after deciding on a particular attribute A.
𝑮𝒂𝒊𝒏( , ) = ( ) − ( , )
𝑫 𝑨 𝑬 𝑫 𝑬 𝑫 𝑨
• The information gain is the decrease in entropy after a dataset
is split on an attribute.
• Constructing a decision tree is all about finding attribute that
returns the highest information gain (i.e., the most
homogeneous branches).
Decision Tree - Example
Training set
15 Rain High Weak ?
Predict will John
play tennis ?
Day Outlook Humidity Wind Play
1 Sunny High Weak No
2 Sunny High Strong No
3 Cloudy High Weak Yes
4 Rain High Weak Yes
5 Rain Normal Weak Yes
6 Rain Normal Strong No
7 Cloudy Normal Strong Yes
8 Sunny High Weak No
9 Sunny Normal Weak Yes
10 Rain Normal Weak Yes
11 Sunny Normal Strong Yes
12 Cloudy High Strong Yes
13 Cloudy Normal Weak Yes
14 Rain High Strong No
Algorithm
decision tree DECISION TREE IN MACHINE .pptx
decision tree DECISION TREE IN MACHINE .pptx
decision tree DECISION TREE IN MACHINE .pptx
decision tree DECISION TREE IN MACHINE .pptx
decision tree DECISION TREE IN MACHINE .pptx
decision tree DECISION TREE IN MACHINE .pptx
decision tree DECISION TREE IN MACHINE .pptx
decision tree DECISION TREE IN MACHINE .pptx
decision tree DECISION TREE IN MACHINE .pptx
Decision tree
Prediction
Outlook ?
sunny rain
cloudy
Yes
Humidity ?
Yes
No
Wind ?
Yes
No
high normal strong weak
Day Outlook Humidity Wind Play
15 Rain High Weak ?
Predict will John
play tennis ?
Yes
RID Age Salary Employee feedback Purchase
1 <=30 High No Fair No
2 <=30 High No Excellent No
3 31..40 High No Fair Yes
4 >40 Medium No Fair Yes
5 >40 Low Yes Fair Yes
6 >40 Low Yes Excellent No
7 31..40 Low Yes Excellent Yes
8 <=30 Medium No Fair No
9 <=30 Low Yes Fair Yes
10 >40 Medium Yes Fair Yes
11 <=30 Medium Yes Excellent Yes
12 31..40 Medium No Excellent Yes
13 31..40 High Yes Fair Yes
Sample MCQ
Internal nodes of a decision tree correspond to:
• A. Decision
• B. Classes
• C. Data instances
• D. None of the above
Correct Answer: Decision
Leaf nodes of a decision tree correspond to:
• A. Decision
• B. Classes
• C. Data instances
• D. None of the above Accepted
Correct Answer: Classes
Consider the following small data table for two classes of woods. Using
information gain, construct a decision tree to classify the data set.
Answer the following question for the resulting tree.
Which attribute would information gain choose as the root of the tree?
A. Density B. Grain C. Hardness D. None of the above
Correct Answer: Hardness
________is a decision support tool that uses a tree-like graph or
model of decisions and their possible consequences, including
chance event outcomes, resource costs, and utility.
(a) Decision tree
(b) Graphs
(c) Trees
(d) Networks
Correct Answer: Decision tree
Age Competition Type Profi
t
Old Yes Software Dow
n
Old No Software Dow
n
Old No Hardware Dow
n
Mid Yes Software Dow
n
Mid Yes Hardware Dow
n
Mid No Hardware Up
Mid No Software Up
New Yes Software Up
New No Hardware Up
New No Software Up
Exercise

More Related Content

PPTX
3. Tree Models in machine learning
PPT
Data Mining Concepts and Techniques.ppt
PPT
Data Mining Concepts and Techniques.ppt
PDF
Chapter 4.pdf
PPTX
Machine Learning with Python unit-2.pptx
PPTX
DecisionTree.pptx for btech cse student
PPT
classification in data warehouse and mining
PPTX
Decision tree induction
3. Tree Models in machine learning
Data Mining Concepts and Techniques.ppt
Data Mining Concepts and Techniques.ppt
Chapter 4.pdf
Machine Learning with Python unit-2.pptx
DecisionTree.pptx for btech cse student
classification in data warehouse and mining
Decision tree induction

Similar to decision tree DECISION TREE IN MACHINE .pptx (20)

PPTX
Decision tree
PPTX
Dataming-chapter-7-Classification-Basic.pptx
PPTX
Lect9 Decision tree
PDF
Machine Learning Unit-5 Decesion Trees & Random Forest.pdf
PDF
Decision Trees- Random Forests.pdf
PPT
Unit 3classification
PDF
Decision tree
PDF
Decision trees
PPTX
Data mining technique (decision tree)
PPTX
Lecture4.pptx
PPTX
Machine learning tree models for classification
PPT
ClassificationOfMachineLearninginCSE.ppt
PPT
Classification (ML).ppt
PPTX
Decision tree in artificial intelligence
PDF
Decision Tree in classification problems in ML
PPTX
Machine Learning, Decision Tree Learning module_2_ppt.pptx
PDF
08 classbasic
PPT
08 classbasic
PPT
08 classbasic
PPT
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Decision tree
Dataming-chapter-7-Classification-Basic.pptx
Lect9 Decision tree
Machine Learning Unit-5 Decesion Trees & Random Forest.pdf
Decision Trees- Random Forests.pdf
Unit 3classification
Decision tree
Decision trees
Data mining technique (decision tree)
Lecture4.pptx
Machine learning tree models for classification
ClassificationOfMachineLearninginCSE.ppt
Classification (ML).ppt
Decision tree in artificial intelligence
Decision Tree in classification problems in ML
Machine Learning, Decision Tree Learning module_2_ppt.pptx
08 classbasic
08 classbasic
08 classbasic
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Ad

More from angelinjeba6 (20)

PPTX
NLP-Components NLP-ComponentsNLP-Components.pptx
PPTX
REVIEW_Practicum1_NLP REVIEW_Practicum1_NLP.pptx
PPTX
STUDENT ACTIVITIES_NLP STUDENT ACTIVITIES_NLP.pptx
PPTX
AI-in-Cybersecurity AI-in-Cybersecurity.pptx
PPTX
Applying-AIAI-in-CybersecurityAI-in-Cybersecurity-in-Cybersecurity.pptx
PPTX
Exercise no: 6 java script fundamentals.pptx
PPTX
1 Intro of web technology and sciences .pptx
PPT
rules classifier in machine learning .ppt
PPTX
21. Regression Tree in machine learning.pptx
PPTX
Loss function in machine learning .pptx
PPTX
Module 1 Taxonomy of Machine L(1).pptx
PPTX
K means ALGORITHM IN MACHINE LEARNING.pptx
PPTX
Support vector machine_new SVM presentation.pptx
PPTX
INTELL ACTUAL PROPERTY. INTELL ACTUAL PROPERTY.pptx
PPTX
Multiple Linear Regressionnnnnnnnnnn.pptx
PPTX
normalisation jdsuhduswwhdusw cdscsacasc.pptx
PPT
311----introduction tomachinelearning.ppt
PPTX
Dynamic and Embedded SQL for db practices.pptx
PPT
artificial engineering the future of computing
PPTX
1 Json Intro and datatype PRESENTATION.pptx
NLP-Components NLP-ComponentsNLP-Components.pptx
REVIEW_Practicum1_NLP REVIEW_Practicum1_NLP.pptx
STUDENT ACTIVITIES_NLP STUDENT ACTIVITIES_NLP.pptx
AI-in-Cybersecurity AI-in-Cybersecurity.pptx
Applying-AIAI-in-CybersecurityAI-in-Cybersecurity-in-Cybersecurity.pptx
Exercise no: 6 java script fundamentals.pptx
1 Intro of web technology and sciences .pptx
rules classifier in machine learning .ppt
21. Regression Tree in machine learning.pptx
Loss function in machine learning .pptx
Module 1 Taxonomy of Machine L(1).pptx
K means ALGORITHM IN MACHINE LEARNING.pptx
Support vector machine_new SVM presentation.pptx
INTELL ACTUAL PROPERTY. INTELL ACTUAL PROPERTY.pptx
Multiple Linear Regressionnnnnnnnnnn.pptx
normalisation jdsuhduswwhdusw cdscsacasc.pptx
311----introduction tomachinelearning.ppt
Dynamic and Embedded SQL for db practices.pptx
artificial engineering the future of computing
1 Json Intro and datatype PRESENTATION.pptx
Ad

Recently uploaded (20)

DOCX
573137875-Attendance-Management-System-original
PPTX
OOP with Java - Java Introduction (Basics)
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
PPT on Performance Review to get promotions
PPTX
additive manufacturing of ss316l using mig welding
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
composite construction of structures.pdf
PPTX
web development for engineering and engineering
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Sustainable Sites - Green Building Construction
573137875-Attendance-Management-System-original
OOP with Java - Java Introduction (Basics)
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPT on Performance Review to get promotions
additive manufacturing of ss316l using mig welding
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
composite construction of structures.pdf
web development for engineering and engineering
Lecture Notes Electrical Wiring System Components
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Foundation to blockchain - A guide to Blockchain Tech
Structs to JSON How Go Powers REST APIs.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Sustainable Sites - Green Building Construction

decision tree DECISION TREE IN MACHINE .pptx

  • 2. Decision Tree • Decision tree is a supervised machine learning technique, based on the divide and conquer paradigm. • The basic idea behind decision trees is to partition the space into patches and to fit a model to a patch. • A decision tree is a tree structure, where each internal node (non-leaf node) denotes a test on an attribute, each branch represents an outcome of the test, and each leaf node (or terminal node) holds a class label. • A decision tree is a classifier expressed as a recursive partition of the instance space. • Decision trees are used for classification task.
  • 4. Building Decision Tree The core algorithm for building decision trees called ID3 employs a top- down, greedy search through the space of possible branches with no backtracking. ID3 uses Entropy and Information Gain to construct a decision tree. • The tree starts as a single node, N, representing the training records in D. • If the records in D are all of the same class, then node N becomes a leaf and is labeled with that class. • Otherwise, the algorithm calls Attribute selection method to determine the splitting criterion. The splitting criterion tells us which attribute to test at node N by determining the “best” way to separate or partition the tuples in D into individual classes.
  • 6. Information Gain • Information gain is Gain(D,A) for a set D is the effective change in entropy after deciding on a particular attribute A. 𝑮𝒂𝒊𝒏( , ) = ( ) − ( , ) 𝑫 𝑨 𝑬 𝑫 𝑬 𝑫 𝑨 • The information gain is the decrease in entropy after a dataset is split on an attribute. • Constructing a decision tree is all about finding attribute that returns the highest information gain (i.e., the most homogeneous branches).
  • 7. Decision Tree - Example
  • 8. Training set 15 Rain High Weak ? Predict will John play tennis ? Day Outlook Humidity Wind Play 1 Sunny High Weak No 2 Sunny High Strong No 3 Cloudy High Weak Yes 4 Rain High Weak Yes 5 Rain Normal Weak Yes 6 Rain Normal Strong No 7 Cloudy Normal Strong Yes 8 Sunny High Weak No 9 Sunny Normal Weak Yes 10 Rain Normal Weak Yes 11 Sunny Normal Strong Yes 12 Cloudy High Strong Yes 13 Cloudy Normal Weak Yes 14 Rain High Strong No
  • 20. Prediction Outlook ? sunny rain cloudy Yes Humidity ? Yes No Wind ? Yes No high normal strong weak Day Outlook Humidity Wind Play 15 Rain High Weak ? Predict will John play tennis ? Yes
  • 21. RID Age Salary Employee feedback Purchase 1 <=30 High No Fair No 2 <=30 High No Excellent No 3 31..40 High No Fair Yes 4 >40 Medium No Fair Yes 5 >40 Low Yes Fair Yes 6 >40 Low Yes Excellent No 7 31..40 Low Yes Excellent Yes 8 <=30 Medium No Fair No 9 <=30 Low Yes Fair Yes 10 >40 Medium Yes Fair Yes 11 <=30 Medium Yes Excellent Yes 12 31..40 Medium No Excellent Yes 13 31..40 High Yes Fair Yes
  • 22. Sample MCQ Internal nodes of a decision tree correspond to: • A. Decision • B. Classes • C. Data instances • D. None of the above Correct Answer: Decision
  • 23. Leaf nodes of a decision tree correspond to: • A. Decision • B. Classes • C. Data instances • D. None of the above Accepted Correct Answer: Classes
  • 24. Consider the following small data table for two classes of woods. Using information gain, construct a decision tree to classify the data set. Answer the following question for the resulting tree. Which attribute would information gain choose as the root of the tree? A. Density B. Grain C. Hardness D. None of the above Correct Answer: Hardness
  • 25. ________is a decision support tool that uses a tree-like graph or model of decisions and their possible consequences, including chance event outcomes, resource costs, and utility. (a) Decision tree (b) Graphs (c) Trees (d) Networks Correct Answer: Decision tree
  • 26. Age Competition Type Profi t Old Yes Software Dow n Old No Software Dow n Old No Hardware Dow n Mid Yes Software Dow n Mid Yes Hardware Dow n Mid No Hardware Up Mid No Software Up New Yes Software Up New No Hardware Up New No Software Up Exercise