Professional Documents
Culture Documents
ARAIB KHAN (081) Section B
ARAIB KHAN (081) Section B
KHAN
Certainly! Let's calculate the information gain for each feature based on the
provided dataset.
Entropy Calculations:
\Outlook:
\[ Gain(\text{Outlook}) = Entropy(D) - \left(\frac{5}{14} \cdot
Entropy(D_{\text{Sunny}}) + \frac{4}{14} \cdot Entropy(D_{\
text{Overcast}}) + \frac{5}{14} \cdot Entropy(D_{\text{Rain}})\right) \]
Temperature:
\[ Gain(\text{Temperature}) = Entropy(D) - \left(\frac{4}{14} \cdot
Entropy(D_{\text{Hot}}) + \frac{4}{14} \cdot Entropy(D_{\text{Mild}}) +
\frac{6}{14} \cdot Entropy(D_{\text{Cool}})\right) \]
Humidity
\[ Gain(\text{Humidity}) = Entropy(D) - \left(\frac{7}{14} \cdot
Entropy(D_{\text{High}}) + \frac{7}{14} \cdot Entropy(D_{\
text{Normal}})\right) \]
Wind:
\[ Gain(\text{Wind}) = Entropy(D) - \left(\frac{8}{14} \cdot
Entropy(D_{\text{Weak}}) + \frac{6}{14} \cdot Entropy(D_{\
text{Strong}})\right) \]
Results:
Outlook:
- \( Gain(\text{Outlook}) = 0.246 \)
Temperature:
- \( Gain(\text{Temperature}) = 0.029 \)
Humidity:
- \( Gain(\text{Humidity}) = 0.151 \)
Wind:
- \( Gain(\text{Wind}) = 0.048 \)