Information Technology Reference
In-Depth Information
represent positive example and negative example respectively. What we should
do is to construct decision tree and classify the data.
Since the number of examples belong to class
P
and
N
is 12 at beginning,
entropy value is:
12
12
12
12
H
(
X
)
=
log
log
=
1
24
24
24
24
If Outlook is selected as test attribute, then according to formula (7.23), condition
entropy is:
9
4
4
5
5
8
1
1
7
7
H
(
X
/
Outlook
)
=
(
log
log
)
+
(
log
log
)
24
9
9
9
9
24
8
8
8
8
7
1
1
6
6
+
(
log
log
)
=
0
.
5528
24
7
7
7
7
Table 7.2 Daily weather classification
Attribute
Outlook
Temperature
Humidity
Wind
Class
1
Overcast
Hot
High
Not
N
2
Overcast
Hot
High
Very
N
3
Overcast
Hot
High
Medium
N
4
Sunny
Hot
High
Not
P
5
Sunny
Hot
High
Medium
P
6
Rain
Mild
High
Not
N
7
Rain
Mild
High
Medium
N
8
Rain
Hot
Normal
Not
P
9
Rain
Cool
Normal
Medium
N
10
Rain
Hot
Normal
Very
N
11
Sunny
Cool
Normal
Very
P
12
Sunny
Cool
Normal
Medium
P
13
Overcast
Mild
High
Not
N
14
Overcast
Mild
High
Medium
N
15
Overcast
Cool
Normal
Not
P
16
Overcast
Cool
Normal
Medium
P
17
Rain
Mild
Normal
Not
N
18
Rain
Mild
Normal
Medium
N
19
Overcast
Mild
Normal
Medium
P
20
Overcast
Mild
Normal
Very
P
21
Sunny
Mild
High
Very
P
22
Sunny
Mild
High
Medium
P
23
Sunny
Hot
Normal
Not
P
24
Rain
Mild
High
Very
N
If Temperature is selected as test attribute, then:
8
4
4
4
4
11
4
4
7
7
H
(
X
/
Temp
)
=
(
log
log
)
+
(
log
log
)
24
8
8
8
8
24
11
11
11
11
5
4
4
1
1
+
(
log
log
)
=
0
.
6739
24
5
5
5
5
If Humidity is selected as test attribute, then:
Search WWH ::




Custom Search