Build decision trees using ID3 (Information Gain) and Gini Index algorithms.
| Feature | Info Gain | Gini Gain |
|---|---|---|
| Outlook | 0.2467 | 0.1163 |
| Humidity | 0.1518 | 0.0918 |
| Wind | 0.0481 | 0.0306 |
| Temperature | 0.0292 | 0.0187 |
| # | Outlook | Temperature | Humidity | Wind | Play Tennis |
|---|---|---|---|---|---|
| 1 | Sunny | Hot | High | Weak | No |
| 2 | Sunny | Hot | High | Strong | No |
| 3 | Overcast | Hot | High | Weak | Yes |
| 4 | Rain | Mild | High | Weak | Yes |
| 5 | Rain | Cool | Normal | Weak | Yes |
| 6 | Rain | Cool | Normal | Strong | No |
| 7 | Overcast | Cool | Normal | Strong | Yes |
| 8 | Sunny | Mild | High | Weak | No |
| 9 | Sunny | Cool | Normal | Weak | Yes |
| 10 | Rain | Mild | Normal | Weak | Yes |
| 11 | Sunny | Mild | Normal | Strong | Yes |
| 12 | Overcast | Mild | High | Strong | Yes |
| 13 | Overcast | Hot | Normal | Weak | Yes |
| 14 | Rain | Mild | High | Strong | No |
H(S) = -Σ p(x) · log₂(p(x))
Information Gain = H(parent) - Σ(|Sv|/|S|) · H(Sv)
Gini(S) = 1 - Σ p(x)²
Gini Gain = Gini(parent) - Σ(|Sv|/|S|) · Gini(Sv)