Articles → MACHINE LEARNING → Decision Tree Algorithm In Machine Learning

Decision Tree Algorithm In Machine Learning






Purpose





Example




OutlookTemperatureHumidityWindPlay Tennis
SunnyHotHighWeakNo
SunnyHotHighStrongNo
OvercastHotHighWeakYes
RainMildHighWeakYes
RainCoolNormalWeakYes
RainCoolNormalStrongNo
OvercastCoolNormalStrongYes
SunnyMildHighWeakNo
SunnyCoolNormalWeakYes
RainMildNormalWeakYes
SunnyMildNormalStrongYes
OvercastMildHighStrongYes
OvercastHotNormalWeakYes
RainMildHighStrongNo





Entropy Of The Dataset





Calculation Of Entropy And Information Gain At Level 1




OutlookEntropy
Sunny0.971
Overcast0
Rain0.971
Entropy of Outlook0.693
Information Gain of Outlook0.247


HumidityEntropy
High 0.985
Normal0.592
Entropy of Humidity0.789
Information Gain of Humidity0.151


TemperatureEntropy
Hot1
Mild0.918
Cool0.811
Entropy of Temperature0.911
Information Gain of Temperature0.029


WindEntropy
Weak0.811
Strong1
Entropy of Wind0.892
Information Gain of Wind0.048





Find The Entropy And Information Gain For Outlook = Sunny




OutlookTemperaturePlay Tennis
SunnyHotNo
SunnyHotNo
SunnyMildNo
SunnyCoolYes
SunnyMildYes


TemperatureEntropy
Hot0
Mild1
Cool0
Entropy of Outlook = Sunny + Temperature0.4
Information Gain of Outlook = Sunny + Temperature0.571




OutlookWindPlay Tennis
SunnyWeakNo
SunnyStrongNo
SunnyWeakNo
SunnyWeakYes
SunnyStrongYes


WindEntropy
Strong1
Weak0.918
Entropy of Outlook = Sunny + Wind0.95
Information Gain of Outlook = Sunny + Wind0.021




OutlookHumidityPlay Tennis
SunnyHighNo
SunnyHighNo
SunnyHighNo
SunnyNormalYes
SunnyNormalYes


HumidityEntropy
High0
Normal0
Entropy0
Information Gain0.971



Find The Entropy And Information Gain For Outlook = Overcast




OutlookTemperaturePlay Tennis
OvercastHotYes
OvercastCoolYes
OvercastMildYes
OvercastHotYes


TemperatureEntropy
Hot0
Mild0
Cool0
Entropy0
Information Gain0




OutlookWindPlay Tennis
OvercastWeakYes
OvercastStrongYes
OvercastStrongYes
OvercastWeakYes


WindEntropy
Strong0
Weak0
Entropy 0
Information Gain 0




OutlookHumidityPlay Tennis
OvercastHighYes
OvercastNormalYes
OvercastHighYes
OvercastNormalYes


HumidityEntropy
High0
Normal0
Entropy0
Information Gain0



Find The Entropy And Information Gain For Outlook = Rain




OutlookTemperaturePlay Tennis
RainMildYes
RainCoolYes
RainCoolNo
RainMildYes
RainMildNo


TemperatureEntropy
HotNA
Mild0.918
Cool1
Entropy0.951
Information Gain0.02




OutlookWindPlay Tennis
RainWeakYes
RainWeakYes
RainStrongNo
RainWeakYes
RainStrongNo


WindEntropy
Strong0
Weak0
Entropy of Outlook0
Information Gain0.971




OutlookHumidityPlay Tennis
RainHighYes
RainNormalYes
RainNormalNo
RainNormalYes
RainHighNo


HumidityEntropy
High1
Normal0.918
Entropy0.95
Information Gain0.021



Conclusion




OutlookWindPlay Tennis
RainWeakYes
RainStrongNo


OutlookPlay Tennis
SunnyNo
SunnyYes
OutlookPlay Tennis
OvercastYes





Posted By  -  Karan Gupta
 
Posted On  -  Friday, September 12, 2025

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250