SlideShare a Scribd company logo
1 of 15
Download to read offline
ID3 (Decision tree)
Amir Shokri
1399/09/25
Concept learning
Entropy :
Entropy(S) :
Gain(S, A):
Amir Shokri
෍
𝑖=1
βˆ’π‘π‘– βˆ— log2(𝑝𝑖)
(βˆ’π‘+ log2 𝑝+ ) βˆ’ (βˆ’π‘βˆ’ log2 π‘βˆ’ )
πΈπ‘›π‘‘π‘Ÿπ‘œπ‘β„Žπ‘¦ 𝑆 βˆ’ ෍
𝑣=π‘‰π‘Žπ‘™π‘’π‘’π‘ (𝐴)
𝑆 𝑣
𝑆
πΈπ‘›π‘‘π‘Ÿπ‘œπ‘β„Žπ‘¦(𝑆 𝑣)
ID3
Amir Shokri
PlayWindyHumidityTemperatureOutlookDay
YesFalseHighHotOvercast1
YesFalseHighMildRainy2
NOFalseNormalCoolRainy3
NoFalseHighMildSunny4
YesFalseHighMildOvercast5
NoTrueNormalCoolSunny6
YesTrueNormalHotSunny7
YesFalseHighCoolRainy8
YesFalseHighCoolSunny9
YesTrueNormalCoolOvercast10
YesTrueHighHotSunny11
YesTrueHighHotRainy12
ID3
Amir Shokri
෍
𝑖=1
βˆ’π‘π‘– βˆ— log2 𝑝𝑖 = βˆ’
3
12
log2
3
12
βˆ’
9
12
log2
9
12
= 0.811
Entropy
ID3
Amir Shokri
Gain outlook:
Gain(S, outlook) = 0.811 βˆ’ (0 +0.27 +0.40) = 0.141
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(π‘œπ‘£π‘’π‘Ÿπ‘π‘Žπ‘ π‘‘) => βˆ’
3
12
3
3
log
3
3
+
0
3
log
0
3
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(π‘Ÿπ‘Žπ‘–π‘›π‘¦) => βˆ’
4
12
3
4
log
3
4
+
1
4
log
1
4
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(𝑠𝑒𝑛𝑛𝑦) => βˆ’
5
12
3
5
log
3
5
+
2
5
log
2
5
πΊπ‘Žπ‘–π‘› 𝑆, outlook = 0.811 βˆ’ 0 + 0.27 + 0.4 = 0.141
ID3
Amir Shokri
Gain Temperature:
Gain(S, Temperature) = 0.811 βˆ’(0 +0.4 +0.29) = 0.121
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(hot) => βˆ’
4
12
4
4
log
4
4
+
0
4
log
0
4
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(mild) => βˆ’
3
12
2
3
log
2
3
+
1
3
log
1
3
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(cool) => βˆ’
5
12
3
5
log
3
5
+
2
5
log
2
5
πΊπ‘Žπ‘–π‘› 𝑆, Temperature = 0.811 βˆ’ 0 + 0.4 + 0.29 = 0.121
ID3
Amir Shokri
Gain Humidity:
Gain(S, Humidity) = 0.811 βˆ’(0.33 + 0.36) = 0.121
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ high => βˆ’
8
12
7
8
log
7
8
+
1
8
log
1
8
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ normal => βˆ’
4
12
2
3
log
2
3
+
2
3
log
2
3
πΊπ‘Žπ‘–π‘› 𝑆, Humidity = 0.811 βˆ’ 0.33 + 0.36 = 0.121
ID3
Amir Shokri
Gain Windy:
Gain(S, Windy) = 0.811 βˆ’(0.3 + 0.3) = 0.011
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ false => βˆ’
7
12
5
7
log
5
7
+
2
7
log
2
7
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ true => βˆ’
5
12
4
5
log
4
5
+
1
5
log
1
5
πΊπ‘Žπ‘–π‘› 𝑆, Windy = 0.811 βˆ’ 0.5 + 0.3 = 0.011
ID3
Temperature
yes
mild
Entropy(s) = 0.918
cool
Entropy(s) = 0.971
hot
? ?
ID3
Temperature
yes
mild
Entropy(s) = 0.918
coolhot
yes
outlook
rainy
sunny overcast
yes yes yes
?
ID3
Amir Shokri
Gain outlook: (temperature = cool)
Gain(temperature, outlook) = 0.918 βˆ’ (0 +0.4 +0.4) = 0.118
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(π‘œπ‘£π‘’π‘Ÿπ‘π‘Žπ‘ π‘‘) => βˆ’
1
5
1
1
log
1
1
+
0
1
log
0
1
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(π‘Ÿπ‘Žπ‘–π‘›π‘¦) => βˆ’
2
5
1
2
log
1
2
+
1
2
log
1
2
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(𝑠𝑒𝑛𝑛𝑦) => βˆ’
2
5
1
2
log
1
2
+
1
2
log
1
2
πΊπ‘Žπ‘–π‘› temperature, outlook = 0.918 βˆ’ 0 + 0.4 + 0.4 = 0.118
ID3
Amir Shokri
Gain Humidity: (temperature = cool)
Gain(temperature, Humidity) = 0.918 βˆ’(0 + 0.36) = 0.121
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ high => βˆ’
2
5
2
2
log
2
2
+
0
2
log
0
2
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ normal => βˆ’
3
5
1
3
log
1
3
+
2
3
log
2
3
πΊπ‘Žπ‘–π‘› temperature, Humidity = 0.918 βˆ’ 0 + 0.55 = 0.368
ID3
Amir Shokri
Gain Windy: (temperature = cool)
Gain(temperature, Windy) = 0.918 βˆ’(0.4 + 0.5) = 0.018
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ true => βˆ’
2
5
1
2
log
1
2
+
1
2
log
1
2
π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ false => βˆ’
3
5
2
3
log
2
3
+
1
3
log
1
3
πΊπ‘Žπ‘–π‘› temperature, Windy = 0.918 βˆ’ 0.4 + 0.5 = 0.018
ID3
Temperature
yes
mild
Entropy(s) = 0.918
coolhot
Humidity
yes
high Normaloutlook
rainy
sunny overcast
yes yes yes
outlook
sunny overcast
no no yes
rainy
References
Machine learning book - Thomas Mitchell
Amir Shokri

More Related Content

More from Amir Shokri

beyesian learning exercises
beyesian learning exercisesbeyesian learning exercises
beyesian learning exercisesAmir Shokri
Β 
Bayesian learning
Bayesian learningBayesian learning
Bayesian learningAmir Shokri
Β 
machine learning code
machine learning codemachine learning code
machine learning codeAmir Shokri
Β 
machine learning - id3, find-s, candidate elimination, desicion tree example
machine learning - id3, find-s, candidate elimination, desicion tree examplemachine learning - id3, find-s, candidate elimination, desicion tree example
machine learning - id3, find-s, candidate elimination, desicion tree exampleAmir Shokri
Β 
Concept learning
Concept learningConcept learning
Concept learningAmir Shokri
Β 
logical operators decision tree
logical operators decision treelogical operators decision tree
logical operators decision treeAmir Shokri
Β 
Matplotlib
MatplotlibMatplotlib
MatplotlibAmir Shokri
Β 
Mining social network graphs - persian
Mining social network graphs - persianMining social network graphs - persian
Mining social network graphs - persianAmir Shokri
Β 
product glossary
product glossaryproduct glossary
product glossaryAmir Shokri
Β 
Popular Maple codes Book - Persian
Popular Maple codes Book - PersianPopular Maple codes Book - Persian
Popular Maple codes Book - PersianAmir Shokri
Β 
deepswarm optimising convolutional neural networks using swarm intelligence (...
deepswarm optimising convolutional neural networks using swarm intelligence (...deepswarm optimising convolutional neural networks using swarm intelligence (...
deepswarm optimising convolutional neural networks using swarm intelligence (...Amir Shokri
Β 
clustering tendency
clustering tendencyclustering tendency
clustering tendencyAmir Shokri
Β 
adaptive comprehensive learning bacterial foraging optimization and its appli...
adaptive comprehensive learning bacterial foraging optimization and its appli...adaptive comprehensive learning bacterial foraging optimization and its appli...
adaptive comprehensive learning bacterial foraging optimization and its appli...Amir Shokri
Β 
particle swarm optimized autonomous learning fuzzy system
particle swarm optimized autonomous learning fuzzy systemparticle swarm optimized autonomous learning fuzzy system
particle swarm optimized autonomous learning fuzzy systemAmir Shokri
Β 
Steganography
SteganographySteganography
SteganographyAmir Shokri
Β 
Dynamic Channel Allocation Using Simulated Annealing In 802.11 WLANs
Dynamic Channel Allocation Using Simulated Annealing In 802.11 WLANs Dynamic Channel Allocation Using Simulated Annealing In 802.11 WLANs
Dynamic Channel Allocation Using Simulated Annealing In 802.11 WLANs Amir Shokri
Β 
Study on the application of genetic algorithms in the optimization of wireles...
Study on the application of genetic algorithms in the optimization of wireles...Study on the application of genetic algorithms in the optimization of wireles...
Study on the application of genetic algorithms in the optimization of wireles...Amir Shokri
Β 
Complexity analysis of multilayer perceptron neural network embedded into a w...
Complexity analysis of multilayer perceptron neural network embedded into a w...Complexity analysis of multilayer perceptron neural network embedded into a w...
Complexity analysis of multilayer perceptron neural network embedded into a w...Amir Shokri
Β 

More from Amir Shokri (20)

key.net
key.netkey.net
key.net
Β 
beyesian learning exercises
beyesian learning exercisesbeyesian learning exercises
beyesian learning exercises
Β 
Knn
KnnKnn
Knn
Β 
Bayesian learning
Bayesian learningBayesian learning
Bayesian learning
Β 
machine learning code
machine learning codemachine learning code
machine learning code
Β 
machine learning - id3, find-s, candidate elimination, desicion tree example
machine learning - id3, find-s, candidate elimination, desicion tree examplemachine learning - id3, find-s, candidate elimination, desicion tree example
machine learning - id3, find-s, candidate elimination, desicion tree example
Β 
Concept learning
Concept learningConcept learning
Concept learning
Β 
logical operators decision tree
logical operators decision treelogical operators decision tree
logical operators decision tree
Β 
Matplotlib
MatplotlibMatplotlib
Matplotlib
Β 
Mining social network graphs - persian
Mining social network graphs - persianMining social network graphs - persian
Mining social network graphs - persian
Β 
product glossary
product glossaryproduct glossary
product glossary
Β 
Popular Maple codes Book - Persian
Popular Maple codes Book - PersianPopular Maple codes Book - Persian
Popular Maple codes Book - Persian
Β 
deepswarm optimising convolutional neural networks using swarm intelligence (...
deepswarm optimising convolutional neural networks using swarm intelligence (...deepswarm optimising convolutional neural networks using swarm intelligence (...
deepswarm optimising convolutional neural networks using swarm intelligence (...
Β 
clustering tendency
clustering tendencyclustering tendency
clustering tendency
Β 
adaptive comprehensive learning bacterial foraging optimization and its appli...
adaptive comprehensive learning bacterial foraging optimization and its appli...adaptive comprehensive learning bacterial foraging optimization and its appli...
adaptive comprehensive learning bacterial foraging optimization and its appli...
Β 
particle swarm optimized autonomous learning fuzzy system
particle swarm optimized autonomous learning fuzzy systemparticle swarm optimized autonomous learning fuzzy system
particle swarm optimized autonomous learning fuzzy system
Β 
Steganography
SteganographySteganography
Steganography
Β 
Dynamic Channel Allocation Using Simulated Annealing In 802.11 WLANs
Dynamic Channel Allocation Using Simulated Annealing In 802.11 WLANs Dynamic Channel Allocation Using Simulated Annealing In 802.11 WLANs
Dynamic Channel Allocation Using Simulated Annealing In 802.11 WLANs
Β 
Study on the application of genetic algorithms in the optimization of wireles...
Study on the application of genetic algorithms in the optimization of wireles...Study on the application of genetic algorithms in the optimization of wireles...
Study on the application of genetic algorithms in the optimization of wireles...
Β 
Complexity analysis of multilayer perceptron neural network embedded into a w...
Complexity analysis of multilayer perceptron neural network embedded into a w...Complexity analysis of multilayer perceptron neural network embedded into a w...
Complexity analysis of multilayer perceptron neural network embedded into a w...
Β 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
Β 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
Β 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
Β 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
Β 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
Β 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
Β 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
Β 
β€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
β€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...β€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
β€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
Β 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
Β 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
Β 
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈcall girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ9953056974 Low Rate Call Girls In Saket, Delhi NCR
Β 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
Β 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
Β 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
Β 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
Β 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
Β 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
Β 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
Β 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
Β 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Β 
Model Call Girl in Tilak Nagar Delhi reach out to us at πŸ”9953056974πŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at πŸ”9953056974πŸ”Model Call Girl in Tilak Nagar Delhi reach out to us at πŸ”9953056974πŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at πŸ”9953056974πŸ”
Β 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
Β 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
Β 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Β 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
Β 
Model Call Girl in Bikash Puri Delhi reach out to us at πŸ”9953056974πŸ”
Model Call Girl in Bikash Puri  Delhi reach out to us at πŸ”9953056974πŸ”Model Call Girl in Bikash Puri  Delhi reach out to us at πŸ”9953056974πŸ”
Model Call Girl in Bikash Puri Delhi reach out to us at πŸ”9953056974πŸ”
Β 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
Β 
β€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
β€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...β€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
β€œOh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
Β 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
Β 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
Β 
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈcall girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
Β 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
Β 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Β 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Β 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
Β 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
Β 

ID3 Algorithm

  • 1. ID3 (Decision tree) Amir Shokri 1399/09/25
  • 2. Concept learning Entropy : Entropy(S) : Gain(S, A): Amir Shokri ෍ 𝑖=1 βˆ’π‘π‘– βˆ— log2(𝑝𝑖) (βˆ’π‘+ log2 𝑝+ ) βˆ’ (βˆ’π‘βˆ’ log2 π‘βˆ’ ) πΈπ‘›π‘‘π‘Ÿπ‘œπ‘β„Žπ‘¦ 𝑆 βˆ’ ෍ 𝑣=π‘‰π‘Žπ‘™π‘’π‘’π‘ (𝐴) 𝑆 𝑣 𝑆 πΈπ‘›π‘‘π‘Ÿπ‘œπ‘β„Žπ‘¦(𝑆 𝑣)
  • 4. ID3 Amir Shokri ෍ 𝑖=1 βˆ’π‘π‘– βˆ— log2 𝑝𝑖 = βˆ’ 3 12 log2 3 12 βˆ’ 9 12 log2 9 12 = 0.811 Entropy
  • 5. ID3 Amir Shokri Gain outlook: Gain(S, outlook) = 0.811 βˆ’ (0 +0.27 +0.40) = 0.141 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(π‘œπ‘£π‘’π‘Ÿπ‘π‘Žπ‘ π‘‘) => βˆ’ 3 12 3 3 log 3 3 + 0 3 log 0 3 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(π‘Ÿπ‘Žπ‘–π‘›π‘¦) => βˆ’ 4 12 3 4 log 3 4 + 1 4 log 1 4 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(𝑠𝑒𝑛𝑛𝑦) => βˆ’ 5 12 3 5 log 3 5 + 2 5 log 2 5 πΊπ‘Žπ‘–π‘› 𝑆, outlook = 0.811 βˆ’ 0 + 0.27 + 0.4 = 0.141
  • 6. ID3 Amir Shokri Gain Temperature: Gain(S, Temperature) = 0.811 βˆ’(0 +0.4 +0.29) = 0.121 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(hot) => βˆ’ 4 12 4 4 log 4 4 + 0 4 log 0 4 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(mild) => βˆ’ 3 12 2 3 log 2 3 + 1 3 log 1 3 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(cool) => βˆ’ 5 12 3 5 log 3 5 + 2 5 log 2 5 πΊπ‘Žπ‘–π‘› 𝑆, Temperature = 0.811 βˆ’ 0 + 0.4 + 0.29 = 0.121
  • 7. ID3 Amir Shokri Gain Humidity: Gain(S, Humidity) = 0.811 βˆ’(0.33 + 0.36) = 0.121 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ high => βˆ’ 8 12 7 8 log 7 8 + 1 8 log 1 8 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ normal => βˆ’ 4 12 2 3 log 2 3 + 2 3 log 2 3 πΊπ‘Žπ‘–π‘› 𝑆, Humidity = 0.811 βˆ’ 0.33 + 0.36 = 0.121
  • 8. ID3 Amir Shokri Gain Windy: Gain(S, Windy) = 0.811 βˆ’(0.3 + 0.3) = 0.011 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ false => βˆ’ 7 12 5 7 log 5 7 + 2 7 log 2 7 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ true => βˆ’ 5 12 4 5 log 4 5 + 1 5 log 1 5 πΊπ‘Žπ‘–π‘› 𝑆, Windy = 0.811 βˆ’ 0.5 + 0.3 = 0.011
  • 11. ID3 Amir Shokri Gain outlook: (temperature = cool) Gain(temperature, outlook) = 0.918 βˆ’ (0 +0.4 +0.4) = 0.118 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(π‘œπ‘£π‘’π‘Ÿπ‘π‘Žπ‘ π‘‘) => βˆ’ 1 5 1 1 log 1 1 + 0 1 log 0 1 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(π‘Ÿπ‘Žπ‘–π‘›π‘¦) => βˆ’ 2 5 1 2 log 1 2 + 1 2 log 1 2 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦(𝑠𝑒𝑛𝑛𝑦) => βˆ’ 2 5 1 2 log 1 2 + 1 2 log 1 2 πΊπ‘Žπ‘–π‘› temperature, outlook = 0.918 βˆ’ 0 + 0.4 + 0.4 = 0.118
  • 12. ID3 Amir Shokri Gain Humidity: (temperature = cool) Gain(temperature, Humidity) = 0.918 βˆ’(0 + 0.36) = 0.121 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ high => βˆ’ 2 5 2 2 log 2 2 + 0 2 log 0 2 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ normal => βˆ’ 3 5 1 3 log 1 3 + 2 3 log 2 3 πΊπ‘Žπ‘–π‘› temperature, Humidity = 0.918 βˆ’ 0 + 0.55 = 0.368
  • 13. ID3 Amir Shokri Gain Windy: (temperature = cool) Gain(temperature, Windy) = 0.918 βˆ’(0.4 + 0.5) = 0.018 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ true => βˆ’ 2 5 1 2 log 1 2 + 1 2 log 1 2 π‘’π‘›π‘‘π‘Ÿπ‘œπ‘π‘¦ false => βˆ’ 3 5 2 3 log 2 3 + 1 3 log 1 3 πΊπ‘Žπ‘–π‘› temperature, Windy = 0.918 βˆ’ 0.4 + 0.5 = 0.018
  • 14. ID3 Temperature yes mild Entropy(s) = 0.918 coolhot Humidity yes high Normaloutlook rainy sunny overcast yes yes yes outlook sunny overcast no no yes rainy
  • 15. References Machine learning book - Thomas Mitchell Amir Shokri