This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
ID3_output.txt
187 lines (184 loc) · 8.27 KB
/
ID3_output.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
No and Yes Classes: PlayTennis Counter({'yes': 9, 'no': 5})
Entropy of given PlayTennis Data Set: 0.9402859586706309
List of Attributes: ['Outlook', 'Temperature', 'Humidity', 'Wind', 'PlayTennis']
Predicting Attributes: ['Outlook', 'Temperature', 'Humidity', 'Wind']
Information Gain Calculation of Outlook
overcast
Outlook Temperature Humidity Wind PlayTennis
2 overcast hot high weak yes
6 overcast cool normal strong yes
11 overcast mild high strong yes
12 overcast hot normal weak yes
rain
Outlook Temperature Humidity Wind PlayTennis
3 rain mild high weak yes
4 rain cool normal weak yes
5 rain cool normal strong no
9 rain mild normal weak yes
13 rain mild high strong no
sunny
Outlook Temperature Humidity Wind PlayTennis
0 sunny hot high weak no
1 sunny hot high strong no
7 sunny mild high weak no
8 sunny cool normal weak yes
10 sunny mild normal strong yes
No and Yes Classes: PlayTennis Counter({'yes': 4})
No and Yes Classes: PlayTennis Counter({'yes': 3, 'no': 2})
No and Yes Classes: PlayTennis Counter({'no': 3, 'yes': 2})
No and Yes Classes: PlayTennis Counter({'yes': 9, 'no': 5})
Information Gain Calculation of Temperature
cool
Outlook Temperature Humidity Wind PlayTennis
4 rain cool normal weak yes
5 rain cool normal strong no
6 overcast cool normal strong yes
8 sunny cool normal weak yes
hot
Outlook Temperature Humidity Wind PlayTennis
0 sunny hot high weak no
1 sunny hot high strong no
2 overcast hot high weak yes
12 overcast hot normal weak yes
mild
Outlook Temperature Humidity Wind PlayTennis
3 rain mild high weak yes
7 sunny mild high weak no
9 rain mild normal weak yes
10 sunny mild normal strong yes
11 overcast mild high strong yes
13 rain mild high strong no
No and Yes Classes: PlayTennis Counter({'yes': 3, 'no': 1})
No and Yes Classes: PlayTennis Counter({'no': 2, 'yes': 2})
No and Yes Classes: PlayTennis Counter({'yes': 4, 'no': 2})
No and Yes Classes: PlayTennis Counter({'yes': 9, 'no': 5})
Information Gain Calculation of Humidity
high
Outlook Temperature Humidity Wind PlayTennis
0 sunny hot high weak no
1 sunny hot high strong no
2 overcast hot high weak yes
3 rain mild high weak yes
7 sunny mild high weak no
11 overcast mild high strong yes
13 rain mild high strong no
normal
Outlook Temperature Humidity Wind PlayTennis
4 rain cool normal weak yes
5 rain cool normal strong no
6 overcast cool normal strong yes
8 sunny cool normal weak yes
9 rain mild normal weak yes
10 sunny mild normal strong yes
12 overcast hot normal weak yes
No and Yes Classes: PlayTennis Counter({'no': 4, 'yes': 3})
No and Yes Classes: PlayTennis Counter({'yes': 6, 'no': 1})
No and Yes Classes: PlayTennis Counter({'yes': 9, 'no': 5})
Information Gain Calculation of Wind
strong
Outlook Temperature Humidity Wind PlayTennis
1 sunny hot high strong no
5 rain cool normal strong no
6 overcast cool normal strong yes
10 sunny mild normal strong yes
11 overcast mild high strong yes
13 rain mild high strong no
weak
Outlook Temperature Humidity Wind PlayTennis
0 sunny hot high weak no
2 overcast hot high weak yes
3 rain mild high weak yes
4 rain cool normal weak yes
7 sunny mild high weak no
8 sunny cool normal weak yes
9 rain mild normal weak yes
12 overcast hot normal weak yes
No and Yes Classes: PlayTennis Counter({'no': 3, 'yes': 3})
No and Yes Classes: PlayTennis Counter({'yes': 6, 'no': 2})
No and Yes Classes: PlayTennis Counter({'yes': 9, 'no': 5})
Information Gain Calculation of Temperature
cool
Outlook Temperature Humidity Wind PlayTennis
4 rain cool normal weak yes
5 rain cool normal strong no
mild
Outlook Temperature Humidity Wind PlayTennis
3 rain mild high weak yes
9 rain mild normal weak yes
13 rain mild high strong no
No and Yes Classes: PlayTennis Counter({'yes': 1, 'no': 1})
No and Yes Classes: PlayTennis Counter({'yes': 2, 'no': 1})
No and Yes Classes: PlayTennis Counter({'yes': 3, 'no': 2})
Information Gain Calculation of Humidity
high
Outlook Temperature Humidity Wind PlayTennis
3 rain mild high weak yes
13 rain mild high strong no
normal
Outlook Temperature Humidity Wind PlayTennis
4 rain cool normal weak yes
5 rain cool normal strong no
9 rain mild normal weak yes
No and Yes Classes: PlayTennis Counter({'yes': 1, 'no': 1})
No and Yes Classes: PlayTennis Counter({'yes': 2, 'no': 1})
No and Yes Classes: PlayTennis Counter({'yes': 3, 'no': 2})
Information Gain Calculation of Wind
strong
Outlook Temperature Humidity Wind PlayTennis
5 rain cool normal strong no
13 rain mild high strong no
weak
Outlook Temperature Humidity Wind PlayTennis
3 rain mild high weak yes
4 rain cool normal weak yes
9 rain mild normal weak yes
No and Yes Classes: PlayTennis Counter({'no': 2})
No and Yes Classes: PlayTennis Counter({'yes': 3})
No and Yes Classes: PlayTennis Counter({'yes': 3, 'no': 2})
Information Gain Calculation of Temperature
cool
Outlook Temperature Humidity Wind PlayTennis
8 sunny cool normal weak yes
hot
Outlook Temperature Humidity Wind PlayTennis
0 sunny hot high weak no
1 sunny hot high strong no
mild
Outlook Temperature Humidity Wind PlayTennis
7 sunny mild high weak no
10 sunny mild normal strong yes
No and Yes Classes: PlayTennis Counter({'yes': 1})
No and Yes Classes: PlayTennis Counter({'no': 2})
No and Yes Classes: PlayTennis Counter({'no': 1, 'yes': 1})
No and Yes Classes: PlayTennis Counter({'no': 3, 'yes': 2})
Information Gain Calculation of Humidity
high
Outlook Temperature Humidity Wind PlayTennis
0 sunny hot high weak no
1 sunny hot high strong no
7 sunny mild high weak no
normal
Outlook Temperature Humidity Wind PlayTennis
8 sunny cool normal weak yes
10 sunny mild normal strong yes
No and Yes Classes: PlayTennis Counter({'no': 3})
No and Yes Classes: PlayTennis Counter({'yes': 2})
No and Yes Classes: PlayTennis Counter({'no': 3, 'yes': 2})
Information Gain Calculation of Wind
strong
Outlook Temperature Humidity Wind PlayTennis
1 sunny hot high strong no
10 sunny mild normal strong yes
weak
Outlook Temperature Humidity Wind PlayTennis
0 sunny hot high weak no
7 sunny mild high weak no
8 sunny cool normal weak yes
No and Yes Classes: PlayTennis Counter({'no': 1, 'yes': 1})
No and Yes Classes: PlayTennis Counter({'no': 2, 'yes': 1})
No and Yes Classes: PlayTennis Counter({'no': 3, 'yes': 2})
The Resultant Decision Tree is :
{'Outlook': {'overcast': 'yes',
'rain': {'Wind': {'strong': 'no', 'weak': 'yes'}},
'sunny': {'Humidity': {'high': 'no', 'normal': 'yes'}}}}
Accuracy is: 1.0