SlideShare a Scribd company logo
Decision Trees
Premalatha M
Decision Trees
 The core algorithm for building decision trees called ID3
by J. R. Quinlan which 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.
Entropy
 A decision tree is built top-down from a root node and
involves partitioning the data into subsets that contain
instances with similar values (homogenous). ID3 algorithm
uses entropy to calculate the homogeneity of a sample. If
the sample is completely homogeneous the entropy is
zero and if the sample is an equally divided it has entropy
of one.
Entropy
To build a decision tree, we need to calculate two types of entropy using
frequency tables as follows:
a) Entropy using the frequency table of one attribute:
Data
Day Outlook Temperature Humidity Wind Class: Play ball
D1 Sunny Hot High False No
D2 Sunny Hot High True No
D3 Overcast Hot High False Yes
D4 Rain Mild High False Yes
D5 Rain Cool Normal False Yes
D6 Rain Cool Normal True No
D7 Overcast Cool Normal True Yes
D8 Sunny Mild High False No
D9 Sunny Cool Normal False Yes
D10 Rain Mild Normal False Yes
D11 Sunny Mild Normal True Yes
D12 Overcast Mild High True Yes
D13 Overcast Hot Normal False Yes
D14 Rain Mild High True No
D=14
 Yes = 9
 No=5
 In Outlook,
 Sunny=5 (Y=2, N=3)
 Overcast=4 (Y=4, N=0)
 Rainy=5 (Y=3, N=2)
 InTemp,
 Hot=4 (Y=2, N=2)
 Mild=6 (Y=4, N=2)
 Cool=4 (Y=3, N=1)
 In Humidity,
 High=7 (Y=3, N=4)
 Normal=7 (Y=6, N=1)
 InWind,
 False=8 (Y=6, N=2)
 True=6 (Y=3 N=3)
outlook temperature humidity windy play
yes no yes no yes no yes no yes no
sunny 2 3 hot 2 2 high 3 4 false 6 2 9 5
overcast 4 0 mild 4 2 normal 6 1 true 3 3
rainy 3 2 cool 3 1
sunny 2/9 3/5 hot 2/9 2/5 high 3/9 4/5 false 6/9 2/5 9/14 5/14
overcast 4/9 0/5 mild 4/9 2/5 normal 6/9 1/5 true 3/9 3/5
rainy 3/9 2/5 cool 3/9 1/5
Entropy -
Gain Outlook
 Gainout(d)=Info(D)-Infooutlook(D)
In Outlook,
Sunny=5 (Y=2, N=3)
Overcast=4 (Y=4, N=0)
Rainy=5 (Y=3, N=2)
Gain Temp
 Gaintemp(d)=Info(D)-Infotemp(D)
In Temp,
Hot=4 (Y=2, N=2)
Mild=6 (Y=4, N=2)
Cool=4 (Y=3, N=1)
Gain Hum
 Gainhum(d)=Info(D)-Infohum(D)
In Humidity,
High=7 (Y=3, N=4)
Normal=7 (Y=6, N=1)
Gain Windy
 Gainwind(d)=Info(D)-Infowind(D)
 Maximum Gain -> Outlook = 0.246
In Windy,
False=8 (Y=6, N=2)
True=6 (Y=3 N=3)
Tree with root = Outlook
D=5 [Sunny]
 Yes = 2
 No = 3
 In Temp,
 Hot=2 (Y=0, N=2)
 Mild=2 (Y=1, N=1)
 Cool=1 (Y=1, N=0)
 In Humidity,
 High=3 (Y=0, N=3)
 Normal=2 (Y=2, N=0)
 In Windy,
 False=3 (Y=1, N=2)
 True=2 (Y=1 N=1)
Info(D) - Sunny
Gain Temp - Sunny
 Gaintemp(d)=Info(D)-Infotemp(D)
In Temp,
Hot=2 (Y=0, N=2)
Mild=2 (Y=1, N=1)
Cool=1 (Y=1, N=0)
Gain Hum - Sunny
 Gainhum(d)=Info(D)-Infohum(D)
In Humidity,
High=3 (Y=0, N=3)
Normal=2 (Y=2, N=0)
Gain Windy - Sunny
 Gainwind(d)=Info(D)-Infowind(D)
 Maximum Gain -> Outlook -> Sunny = Hum = 0.971
InWindy,
False=3 (Y=1, N=2)
True=2 (Y=1 N=1)
D=5 [Rainy]
 Yes = 3
 No = 2
 In Temp,
 Hot=0 (Y=0, N=0)
 Mild=3 (Y=2, N=1)
 Cool=2 (Y=1, N=1)
 In Humidity,
 High=2 (Y=1, N=1)
 Normal=3 (Y=2, N=1)
 In Windy,
 False=3 (Y=3, N=0)
 True=2 (Y=0 N=2)
Info(D) - Rainy
Gain Temp - Rainy
 Gaintemp(d)=Info(D)-Infotemp(D)
In Temp,
Hot=0 (Y=0, N=0)
Mild=3 (Y=2, N=1)
Cool=2 (Y=1, N=1)
Gain Hum - Rainy
 Gainhum(d)=Info(D)-Infohum(D)
In Humidity,
High=2 (Y=1, N=1)
Normal=3 (Y=2, N=1)
Gain Windy - Rainy
 Gainwind(d)=Info(D)-Infowind(D)
 Maximum Gain -> Outlook -> Rainy = Windy = 0.971
InWindy,
False=3 (Y=3, N=0)
True=2 (Y=0 N=2)
Predict:
 Outlook=Overcast,Temperature=Mild, Humidity=Normal,Windy=False
 Outlook=rainy, temp=cold, humidiy=normal, windy=true = No
To do
Decision trees
Decision trees

More Related Content

What's hot

Scientific notation ppt
Scientific notation pptScientific notation ppt
Scientific notation pptJessica Garcia
 
Add sub mul_div_scientific_notation
Add sub mul_div_scientific_notationAdd sub mul_div_scientific_notation
Add sub mul_div_scientific_notation
JanelyvieEnrique
 
Scientific notation
Scientific notationScientific notation
Scientific notation
mvelas35
 
SCIENTIFIC NOTATION
SCIENTIFIC NOTATIONSCIENTIFIC NOTATION
SCIENTIFIC NOTATION
QueenniePonce
 
Scientific Notation
Scientific NotationScientific Notation
Scientific Notation
Ver Louie Gautani
 
Scientific notation
Scientific notationScientific notation
Scientific notationserokat
 
Multiply divide scientific notation edmodo 2013 14
Multiply divide scientific notation edmodo 2013 14Multiply divide scientific notation edmodo 2013 14
Multiply divide scientific notation edmodo 2013 14shumwayc
 
Lecture4 scientific notation
Lecture4 scientific notationLecture4 scientific notation
Lecture4 scientific notationVicki Mizner
 
8 4 scientific notation - day 1
8 4 scientific notation - day 18 4 scientific notation - day 1
8 4 scientific notation - day 1bweldon
 
Otter Pop Frenzy
Otter Pop FrenzyOtter Pop Frenzy
Otter Pop Frenzymraston
 
Scientific Notation
Scientific NotationScientific Notation
Scientific Notationcrespiryan
 
89913
 89913 89913
89913
Aliisrar23
 
November 22, 2013
November 22, 2013November 22, 2013
November 22, 2013khyps13
 

What's hot (14)

Scientific Notation
Scientific NotationScientific Notation
Scientific Notation
 
Scientific notation ppt
Scientific notation pptScientific notation ppt
Scientific notation ppt
 
Add sub mul_div_scientific_notation
Add sub mul_div_scientific_notationAdd sub mul_div_scientific_notation
Add sub mul_div_scientific_notation
 
Scientific notation
Scientific notationScientific notation
Scientific notation
 
SCIENTIFIC NOTATION
SCIENTIFIC NOTATIONSCIENTIFIC NOTATION
SCIENTIFIC NOTATION
 
Scientific Notation
Scientific NotationScientific Notation
Scientific Notation
 
Scientific notation
Scientific notationScientific notation
Scientific notation
 
Multiply divide scientific notation edmodo 2013 14
Multiply divide scientific notation edmodo 2013 14Multiply divide scientific notation edmodo 2013 14
Multiply divide scientific notation edmodo 2013 14
 
Lecture4 scientific notation
Lecture4 scientific notationLecture4 scientific notation
Lecture4 scientific notation
 
8 4 scientific notation - day 1
8 4 scientific notation - day 18 4 scientific notation - day 1
8 4 scientific notation - day 1
 
Otter Pop Frenzy
Otter Pop FrenzyOtter Pop Frenzy
Otter Pop Frenzy
 
Scientific Notation
Scientific NotationScientific Notation
Scientific Notation
 
89913
 89913 89913
89913
 
November 22, 2013
November 22, 2013November 22, 2013
November 22, 2013
 

Similar to Decision trees

"Induction of Decision Trees" @ Papers We Love Bucharest
"Induction of Decision Trees" @ Papers We Love Bucharest"Induction of Decision Trees" @ Papers We Love Bucharest
"Induction of Decision Trees" @ Papers We Love Bucharest
Stefan Adam
 
Decision tree in artificial intelligence
Decision tree in artificial intelligenceDecision tree in artificial intelligence
Decision tree in artificial intelligence
MdAlAmin187
 
Nhan_Chapter 6_Classification 2022.pdf
Nhan_Chapter 6_Classification 2022.pdfNhan_Chapter 6_Classification 2022.pdf
Nhan_Chapter 6_Classification 2022.pdf
NhtHong96
 
Id3,c4.5 algorithim
Id3,c4.5 algorithimId3,c4.5 algorithim
Id3,c4.5 algorithim
Abdelfattah Al Zaqqa
 
unit 5 decision tree2.pptx
unit 5 decision tree2.pptxunit 5 decision tree2.pptx
unit 5 decision tree2.pptx
ssuser5c580e1
 
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...butest
 
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data science
MaryamRehman6
 
ID3 Algorithm
ID3 AlgorithmID3 Algorithm
ID3 Algorithm
CherifRehouma
 
Decision Tree Steps
Decision Tree StepsDecision Tree Steps
Decision Tree Steps
Vikash Kumar
 
Decision trees for machine learning
Decision trees for machine learningDecision trees for machine learning
Decision trees for machine learning
Amr BARAKAT
 
Introduction to ML and Decision Tree
Introduction to ML and Decision TreeIntroduction to ML and Decision Tree
Introduction to ML and Decision Tree
Suman Debnath
 
Decision Trees
Decision TreesDecision Trees
Decision Trees
zekeLabs Technologies
 
DMTM 2015 - 11 Decision Trees
DMTM 2015 - 11 Decision TreesDMTM 2015 - 11 Decision Trees
DMTM 2015 - 11 Decision Trees
Pier Luca Lanzi
 
CART Algorithm.pptx
CART Algorithm.pptxCART Algorithm.pptx
CART Algorithm.pptx
SumayaNazir440
 
Machine Learning 2D5362
Machine Learning 2D5362Machine Learning 2D5362
Machine Learning 2D5362butest
 
Decision tree
Decision treeDecision tree
Decision tree
SyedMahmoodAliRoomi
 
Classification intuition
Classification   intuitionClassification   intuition
Classification intuition
Rahul Tiwari
 
ID3_Explanation.pptx
ID3_Explanation.pptxID3_Explanation.pptx
ID3_Explanation.pptx
SanketMani1
 
Id3 algorithm
Id3 algorithmId3 algorithm
Id3 algorithm
SreekuttanJayakumar
 

Similar to Decision trees (20)

"Induction of Decision Trees" @ Papers We Love Bucharest
"Induction of Decision Trees" @ Papers We Love Bucharest"Induction of Decision Trees" @ Papers We Love Bucharest
"Induction of Decision Trees" @ Papers We Love Bucharest
 
Decision tree in artificial intelligence
Decision tree in artificial intelligenceDecision tree in artificial intelligence
Decision tree in artificial intelligence
 
Nhan_Chapter 6_Classification 2022.pdf
Nhan_Chapter 6_Classification 2022.pdfNhan_Chapter 6_Classification 2022.pdf
Nhan_Chapter 6_Classification 2022.pdf
 
Id3,c4.5 algorithim
Id3,c4.5 algorithimId3,c4.5 algorithim
Id3,c4.5 algorithim
 
unit 5 decision tree2.pptx
unit 5 decision tree2.pptxunit 5 decision tree2.pptx
unit 5 decision tree2.pptx
 
Decision tree
Decision treeDecision tree
Decision tree
 
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
 
Decision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data scienceDecision tree induction \ Decision Tree Algorithm with Example| Data science
Decision tree induction \ Decision Tree Algorithm with Example| Data science
 
ID3 Algorithm
ID3 AlgorithmID3 Algorithm
ID3 Algorithm
 
Decision Tree Steps
Decision Tree StepsDecision Tree Steps
Decision Tree Steps
 
Decision trees for machine learning
Decision trees for machine learningDecision trees for machine learning
Decision trees for machine learning
 
Introduction to ML and Decision Tree
Introduction to ML and Decision TreeIntroduction to ML and Decision Tree
Introduction to ML and Decision Tree
 
Decision Trees
Decision TreesDecision Trees
Decision Trees
 
DMTM 2015 - 11 Decision Trees
DMTM 2015 - 11 Decision TreesDMTM 2015 - 11 Decision Trees
DMTM 2015 - 11 Decision Trees
 
CART Algorithm.pptx
CART Algorithm.pptxCART Algorithm.pptx
CART Algorithm.pptx
 
Machine Learning 2D5362
Machine Learning 2D5362Machine Learning 2D5362
Machine Learning 2D5362
 
Decision tree
Decision treeDecision tree
Decision tree
 
Classification intuition
Classification   intuitionClassification   intuition
Classification intuition
 
ID3_Explanation.pptx
ID3_Explanation.pptxID3_Explanation.pptx
ID3_Explanation.pptx
 
Id3 algorithm
Id3 algorithmId3 algorithm
Id3 algorithm
 

More from SatishH5

Some study materials
Some study materialsSome study materials
Some study materials
SatishH5
 
Regression2
Regression2Regression2
Regression2
SatishH5
 
Regression trees lot example
Regression trees lot exampleRegression trees lot example
Regression trees lot example
SatishH5
 
Regression trees
Regression treesRegression trees
Regression trees
SatishH5
 
Regression trees
Regression treesRegression trees
Regression trees
SatishH5
 
Regression tree
Regression treeRegression tree
Regression tree
SatishH5
 
Multi linear regression
Multi linear regressionMulti linear regression
Multi linear regression
SatishH5
 
Module 4 bayes classification
Module 4 bayes classificationModule 4 bayes classification
Module 4 bayes classification
SatishH5
 
Knn classification
Knn classificationKnn classification
Knn classification
SatishH5
 
Knn classification (1)
Knn classification (1)Knn classification (1)
Knn classification (1)
SatishH5
 
Decision tree cart c4.5
Decision tree   cart c4.5Decision tree   cart c4.5
Decision tree cart c4.5
SatishH5
 

More from SatishH5 (11)

Some study materials
Some study materialsSome study materials
Some study materials
 
Regression2
Regression2Regression2
Regression2
 
Regression trees lot example
Regression trees lot exampleRegression trees lot example
Regression trees lot example
 
Regression trees
Regression treesRegression trees
Regression trees
 
Regression trees
Regression treesRegression trees
Regression trees
 
Regression tree
Regression treeRegression tree
Regression tree
 
Multi linear regression
Multi linear regressionMulti linear regression
Multi linear regression
 
Module 4 bayes classification
Module 4 bayes classificationModule 4 bayes classification
Module 4 bayes classification
 
Knn classification
Knn classificationKnn classification
Knn classification
 
Knn classification (1)
Knn classification (1)Knn classification (1)
Knn classification (1)
 
Decision tree cart c4.5
Decision tree   cart c4.5Decision tree   cart c4.5
Decision tree cart c4.5
 

Recently uploaded

In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
vrstrong314
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
abdulrafaychaudhry
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 

Recently uploaded (20)

In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Game Development with Unity3D (Game Development lecture 3)
Game Development  with Unity3D (Game Development lecture 3)Game Development  with Unity3D (Game Development lecture 3)
Game Development with Unity3D (Game Development lecture 3)
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 

Decision trees

  • 2. Decision Trees  The core algorithm for building decision trees called ID3 by J. R. Quinlan which 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.
  • 3. Entropy  A decision tree is built top-down from a root node and involves partitioning the data into subsets that contain instances with similar values (homogenous). ID3 algorithm uses entropy to calculate the homogeneity of a sample. If the sample is completely homogeneous the entropy is zero and if the sample is an equally divided it has entropy of one.
  • 4. Entropy To build a decision tree, we need to calculate two types of entropy using frequency tables as follows: a) Entropy using the frequency table of one attribute:
  • 5. Data Day Outlook Temperature Humidity Wind Class: Play ball D1 Sunny Hot High False No D2 Sunny Hot High True No D3 Overcast Hot High False Yes D4 Rain Mild High False Yes D5 Rain Cool Normal False Yes D6 Rain Cool Normal True No D7 Overcast Cool Normal True Yes D8 Sunny Mild High False No D9 Sunny Cool Normal False Yes D10 Rain Mild Normal False Yes D11 Sunny Mild Normal True Yes D12 Overcast Mild High True Yes D13 Overcast Hot Normal False Yes D14 Rain Mild High True No
  • 6.
  • 7. D=14  Yes = 9  No=5  In Outlook,  Sunny=5 (Y=2, N=3)  Overcast=4 (Y=4, N=0)  Rainy=5 (Y=3, N=2)  InTemp,  Hot=4 (Y=2, N=2)  Mild=6 (Y=4, N=2)  Cool=4 (Y=3, N=1)  In Humidity,  High=7 (Y=3, N=4)  Normal=7 (Y=6, N=1)  InWind,  False=8 (Y=6, N=2)  True=6 (Y=3 N=3) outlook temperature humidity windy play yes no yes no yes no yes no yes no sunny 2 3 hot 2 2 high 3 4 false 6 2 9 5 overcast 4 0 mild 4 2 normal 6 1 true 3 3 rainy 3 2 cool 3 1 sunny 2/9 3/5 hot 2/9 2/5 high 3/9 4/5 false 6/9 2/5 9/14 5/14 overcast 4/9 0/5 mild 4/9 2/5 normal 6/9 1/5 true 3/9 3/5 rainy 3/9 2/5 cool 3/9 1/5
  • 9. Gain Outlook  Gainout(d)=Info(D)-Infooutlook(D) In Outlook, Sunny=5 (Y=2, N=3) Overcast=4 (Y=4, N=0) Rainy=5 (Y=3, N=2)
  • 10. Gain Temp  Gaintemp(d)=Info(D)-Infotemp(D) In Temp, Hot=4 (Y=2, N=2) Mild=6 (Y=4, N=2) Cool=4 (Y=3, N=1)
  • 11. Gain Hum  Gainhum(d)=Info(D)-Infohum(D) In Humidity, High=7 (Y=3, N=4) Normal=7 (Y=6, N=1)
  • 12. Gain Windy  Gainwind(d)=Info(D)-Infowind(D)  Maximum Gain -> Outlook = 0.246 In Windy, False=8 (Y=6, N=2) True=6 (Y=3 N=3)
  • 13. Tree with root = Outlook
  • 14. D=5 [Sunny]  Yes = 2  No = 3  In Temp,  Hot=2 (Y=0, N=2)  Mild=2 (Y=1, N=1)  Cool=1 (Y=1, N=0)  In Humidity,  High=3 (Y=0, N=3)  Normal=2 (Y=2, N=0)  In Windy,  False=3 (Y=1, N=2)  True=2 (Y=1 N=1)
  • 16. Gain Temp - Sunny  Gaintemp(d)=Info(D)-Infotemp(D) In Temp, Hot=2 (Y=0, N=2) Mild=2 (Y=1, N=1) Cool=1 (Y=1, N=0)
  • 17. Gain Hum - Sunny  Gainhum(d)=Info(D)-Infohum(D) In Humidity, High=3 (Y=0, N=3) Normal=2 (Y=2, N=0)
  • 18. Gain Windy - Sunny  Gainwind(d)=Info(D)-Infowind(D)  Maximum Gain -> Outlook -> Sunny = Hum = 0.971 InWindy, False=3 (Y=1, N=2) True=2 (Y=1 N=1)
  • 19.
  • 20. D=5 [Rainy]  Yes = 3  No = 2  In Temp,  Hot=0 (Y=0, N=0)  Mild=3 (Y=2, N=1)  Cool=2 (Y=1, N=1)  In Humidity,  High=2 (Y=1, N=1)  Normal=3 (Y=2, N=1)  In Windy,  False=3 (Y=3, N=0)  True=2 (Y=0 N=2)
  • 22. Gain Temp - Rainy  Gaintemp(d)=Info(D)-Infotemp(D) In Temp, Hot=0 (Y=0, N=0) Mild=3 (Y=2, N=1) Cool=2 (Y=1, N=1)
  • 23. Gain Hum - Rainy  Gainhum(d)=Info(D)-Infohum(D) In Humidity, High=2 (Y=1, N=1) Normal=3 (Y=2, N=1)
  • 24. Gain Windy - Rainy  Gainwind(d)=Info(D)-Infowind(D)  Maximum Gain -> Outlook -> Rainy = Windy = 0.971 InWindy, False=3 (Y=3, N=0) True=2 (Y=0 N=2)
  • 25. Predict:  Outlook=Overcast,Temperature=Mild, Humidity=Normal,Windy=False  Outlook=rainy, temp=cold, humidiy=normal, windy=true = No
  • 26.
  • 27. To do