Let's take an example from Chapter 2, Naive Bayes, again:
Temperature | Wind | Sunshine | Play |
Cold | Strong | Cloudy | No |
Cold | Strong | Cloudy | No |
Warm | None | Sunny | Yes |
Hot | None | Sunny | No |
Hot | Breeze | Cloudy | Yes |
Warm | Breeze | Sunny | Yes |
Cold | Breeze | Cloudy | No |
Cold | None | Sunny | Yes |
Hot | Strong | Cloudy | Yes |
Warm | None | Cloudy | Yes |
Warm | Strong | Sunny | ? |
We would like to find out whether our friend would like to play chess with us in the park. But this time, we would like to use decision trees to find the answer.
We have the initial set, S, of the data samples, as follows:
S={(Cold,Strong,Cloudy,No),(Warm,Strong,Cloudy,No),(Warm,None,Sunny,Yes), (Hot,None,Sunny,No),(Hot,Breeze,Cloudy,Yes),(Warm,Breeze,Sunny,Yes),(Cold,Breeze,Cloudy,No),(Cold,None,Sunny,Yes),(Hot,Strong,Cloudy,Yes),(Warm,None,Cloudy,Yes)}
First, we determine the information gain for each of the three non-classifying attributes: temperature
, wind
, and sunshine
. The possible values for temperature
are Cold
, Warm
, and Hot
. Therefore, we will partition the set...