Articles → MACHINE LEARNING → Information Gain In Machine Learning

Information Gain In Machine Learning






Purpose





Significance





Formula


Picture showing the formula of calculating the information gain


  1. S = the original dataset (before the split)
  2. A = the attribute for which IG is being calculated
  3. v∈Values(A)=each possible value of attribute A
  4. Sv = the subset of 𝑆 where attribute 𝐴 has value
  5. ∣Sv∣ = number of samples in subset Sv
  6. ∣S∣=total number of samples
  7. Entropy(S) = measure of impurity in dataset 𝑆

Sample Dataset




IDOutlookTemperatureHumidityWindyPlay Tennis
1SunnyHotHighFalseNo
2SunnyHotHighTrueNo
3OvercastHotHighFalseYes
4RainMildHighFalseNo
5RainCoolNormalFalseNo
6RainCoolNormalTrueNo
7OvercastCoolNormalTrueYes
8SunnyMildHighFalseYes



Entropy Of Full Dataset




Picture showing the entropy of yes and no for Play Tennis




Picture showing calculating the entropy of whole dataset



Entropy Of Sunny




Picture showing calculating the entropy of sunny attribute



Entropy Of Overcast







Entropy Of Rain







Weighted Average Entropy For Outlook


Picture showing calculating the average entropy of outlook



Information Gain (Outlook)


Picture showing calculating the information gain of outlook





Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, September 2, 2025

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250