SlideShare a Scribd company logo
Decision Tree
&
Random Forest Algorithm
Priagung Khusumanegara
Chonnam National Univeristy
Outline
 Introduction
 Example of Decision Tree
 Principles of Decision Tree
– Entropy
– Information gain
 Random Forest
2
The problem
 Given a set of training cases/objects and their attribute
values, try to determine the target attribute value of new
examples.
– Classification
– Prediction
3
Key Requirements
 Attribute-value description: object or case must be
expressible in terms of a fixed collection of properties or
attributes (e.g., hot, mild, cold).
 Predefined classes (target values): the target
function has discrete output values (bollean or
multiclass)
 Sufficient data: enough training cases should be
provided to learn the model.
4
A simple example
5
Principled Criterion
 Choosing the most useful attribute for classifying examples.
 Entropy
- A measure of homogeneity of the set of examples
- If the sample is completely homogeneous the entropy is zero and if
the sample is an equally divided it has entropy of one
 Information Gain
- Measures how well a given attribute separates the training
examples according to their target classification
- This measure is used to select among the candidate attributes at
each step while growing the tree
6
Information Gain
Step 1 : Calculate entropy of the target
7
Information Gain (Cont’d)
Step 2 : Calculate information gain for each
attribute
8
Information Gain (Cont’d)
Step 3: Choose attribute with the largest
information gain as the decision node.
9
Information Gain (Cont’d)
Step 4a: A branch with entropy of 0 is a leaf
node.
10
Information Gain (Cont’d)
Step 4b: A branch with entropy more than 0
needs further splitting.
11
Information Gain (Cont’d)
Step 5: The algorithm is run recursively on the
non-leaf branches, until all data is classified.
12
Random Forest
 Decision Tree : one tree
 Random Forest : more than one tree
13
Decision Tree & Random Forest
14
Decision Tree
Random Forest
Tree 1 Tree 2
Tree 3
Decision Tree
Outlook Temp. Humidity Windy Play Golf
Rainy Mild High False ?
15
Result : No
Random Forest
16
Tree 1 Tree 2
Tree 3
Tree 1 : No
Tree 2 : No
Tree 3 : Yes
Yes : 1
No : 2
Result : No
OOB Error Rate
 OOB error rate can be used to get a running
unbiased estimate of the classification error
as trees are added to the forest.
17

More Related Content

PPTX
Machine learning session6(decision trees random forrest)
PPTX
Decision Tree Learning: Decision tree representation, Appropriate problems fo...
PPTX
module_3_1.pptx
PPTX
module_3_1.pptx
PPTX
Decision Tree - C4.5&CART
PDF
Machine Learning Algorithm - Decision Trees
PPTX
Decision Tree.pptx
Machine learning session6(decision trees random forrest)
Decision Tree Learning: Decision tree representation, Appropriate problems fo...
module_3_1.pptx
module_3_1.pptx
Decision Tree - C4.5&CART
Machine Learning Algorithm - Decision Trees
Decision Tree.pptx

Similar to decision tree and random forest in AIML for CSE (20)

PDF
CSA 3702 machine learning module 2
PPTX
An algorithm for building
PPTX
Decision tree
PDF
lec02-DecisionTreed. Checking primality of an integer n .pdf
PPTX
Machine Learning with Python unit-2.pptx
PDF
Data Science Machine LearningClassification.pdf
PDF
Decision Tree-ID3,C4.5,CART,Regression Tree
PPTX
Machine Learning, Decision Tree Learning module_2_ppt.pptx
PDF
Lessonweeeeeeeeeeeeeeeeeewwwwwwwwwwwwwwwwwwwww5.pdf
PPTX
unit 5 decision tree2.pptx
PDF
From decision trees to random forests
PPTX
Decision Trees Learning in Machine Learning
PPTX
Machine learning and decision trees
PPT
Using Tree algorithms on machine learning
PPTX
Unit 2-ML.pptx
PPT
Decision tree
PPT
Decision tree
PDF
Machine Learning Unit-5 Decesion Trees & Random Forest.pdf
PPTX
ID3 Algorithm
PDF
Decision tree learning
CSA 3702 machine learning module 2
An algorithm for building
Decision tree
lec02-DecisionTreed. Checking primality of an integer n .pdf
Machine Learning with Python unit-2.pptx
Data Science Machine LearningClassification.pdf
Decision Tree-ID3,C4.5,CART,Regression Tree
Machine Learning, Decision Tree Learning module_2_ppt.pptx
Lessonweeeeeeeeeeeeeeeeeewwwwwwwwwwwwwwwwwwwww5.pdf
unit 5 decision tree2.pptx
From decision trees to random forests
Decision Trees Learning in Machine Learning
Machine learning and decision trees
Using Tree algorithms on machine learning
Unit 2-ML.pptx
Decision tree
Decision tree
Machine Learning Unit-5 Decesion Trees & Random Forest.pdf
ID3 Algorithm
Decision tree learning
Ad

More from premkumar1891 (7)

PDF
Random Forests for AIML for 3rd year ECE department CSE
PDF
Microprocessor and Microcontroller Notes
PDF
AIML notes students study material for CSE IT ECE and other departments
PPTX
BATCH NO FIRST REVIEW Smart trolley-1.pptx
PPTX
TNWise Hackathon PPT industry 4.0 PMC TECH
PDF
Random Forests for Machine Learning ML Decision Tree
PPTX
Robotics lab module 3 ppt 4
Random Forests for AIML for 3rd year ECE department CSE
Microprocessor and Microcontroller Notes
AIML notes students study material for CSE IT ECE and other departments
BATCH NO FIRST REVIEW Smart trolley-1.pptx
TNWise Hackathon PPT industry 4.0 PMC TECH
Random Forests for Machine Learning ML Decision Tree
Robotics lab module 3 ppt 4
Ad

Recently uploaded (20)

PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Institutional Correction lecture only . . .
PDF
Classroom Observation Tools for Teachers
PDF
RMMM.pdf make it easy to upload and study
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Insiders guide to clinical Medicine.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Computing-Curriculum for Schools in Ghana
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Anesthesia in Laparoscopic Surgery in India
Institutional Correction lecture only . . .
Classroom Observation Tools for Teachers
RMMM.pdf make it easy to upload and study
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Insiders guide to clinical Medicine.pdf
01-Introduction-to-Information-Management.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
O5-L3 Freight Transport Ops (International) V1.pdf
Renaissance Architecture: A Journey from Faith to Humanism
102 student loan defaulters named and shamed – Is someone you know on the list?
Computing-Curriculum for Schools in Ghana
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Microbial disease of the cardiovascular and lymphatic systems
PPH.pptx obstetrics and gynecology in nursing
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf

decision tree and random forest in AIML for CSE

  • 1. Decision Tree & Random Forest Algorithm Priagung Khusumanegara Chonnam National Univeristy
  • 2. Outline  Introduction  Example of Decision Tree  Principles of Decision Tree – Entropy – Information gain  Random Forest 2
  • 3. The problem  Given a set of training cases/objects and their attribute values, try to determine the target attribute value of new examples. – Classification – Prediction 3
  • 4. Key Requirements  Attribute-value description: object or case must be expressible in terms of a fixed collection of properties or attributes (e.g., hot, mild, cold).  Predefined classes (target values): the target function has discrete output values (bollean or multiclass)  Sufficient data: enough training cases should be provided to learn the model. 4
  • 6. Principled Criterion  Choosing the most useful attribute for classifying examples.  Entropy - A measure of homogeneity of the set of examples - If the sample is completely homogeneous the entropy is zero and if the sample is an equally divided it has entropy of one  Information Gain - Measures how well a given attribute separates the training examples according to their target classification - This measure is used to select among the candidate attributes at each step while growing the tree 6
  • 7. Information Gain Step 1 : Calculate entropy of the target 7
  • 8. Information Gain (Cont’d) Step 2 : Calculate information gain for each attribute 8
  • 9. Information Gain (Cont’d) Step 3: Choose attribute with the largest information gain as the decision node. 9
  • 10. Information Gain (Cont’d) Step 4a: A branch with entropy of 0 is a leaf node. 10
  • 11. Information Gain (Cont’d) Step 4b: A branch with entropy more than 0 needs further splitting. 11
  • 12. Information Gain (Cont’d) Step 5: The algorithm is run recursively on the non-leaf branches, until all data is classified. 12
  • 13. Random Forest  Decision Tree : one tree  Random Forest : more than one tree 13
  • 14. Decision Tree & Random Forest 14 Decision Tree Random Forest Tree 1 Tree 2 Tree 3
  • 15. Decision Tree Outlook Temp. Humidity Windy Play Golf Rainy Mild High False ? 15 Result : No
  • 16. Random Forest 16 Tree 1 Tree 2 Tree 3 Tree 1 : No Tree 2 : No Tree 3 : Yes Yes : 1 No : 2 Result : No
  • 17. OOB Error Rate  OOB error rate can be used to get a running unbiased estimate of the classification error as trees are added to the forest. 17