Student Name: Mira Khairunnisa Binti Muhammad Amin
Certification of Originality
I hereby confirm and understand that:
Plagiarism (copying / cheating) is not permitted, and if caught and found guilty, I will
receive an F grade for this extended assignment and will be subjected to the Academic
Disciplinary Committee.
All answers submitted for this extended assignment is my own original work.
Signature:
Students’s Name:
Question 1
ID
Gender
Background
English
Mathematics
1
Female
M40
84
76
2
Male
T20
73
78
3
Male
T20
43
98
4
Female
T20
21
99
5
Male
B40
33
40
6
Female
M40
77
55
7
Male
M40
90
67
8
Male
B40
100
54
9
Male
T20
22
33
10
Female
T20
42
100
11
Female
M40
12
23
12
Male
M40
98
19
13
Female
B40
78
60
14
Female
B40
98
69
15
Female
B40
93
90
16
Male
M40
94
99
17
Male
M40
65
11
18
Male
M40
47
45
19
Female
B40
68
65
20
Male
T20
79
78
21
Male
T20
30
90
22
Female
T20
89
87
23
Female
B40
70
89
24
Female
B40
81
76
25
Female
B40
91
79
26
Male
B40
60
68
27
Male
M40
50
54
28
Female
M40
44
98
29
Male
M40
32
94
30
Male
T20
12
93
31
Male
T20
45
90
32
Male
T20
76
95
Based on the training data furnished, compute the Entropy for each of the following cases:
I. The overall collection of the training data
Class
Total
Arts
7
Engineering
8
Science
11
Others
6
Total
32
= – [7/32 log2 (7/32) + 8/32 log2 (8/32) + 11/32 log2 (11/32) + 6/32 log2 (6/32)]
= – [(-0.4796) + (-0.5) + (-0.5296) + (-0.4528)]
= – (-1.962)
= 1.962
II. Gender attribute
Class/Gender
Male
Female
Arts
2
5
Engineering
9
2
Science
3
5
Others
4
2
Total
18
14
Overall Calculation
= – [18/32 log2 (18/32) + 14/32 log2 (14/32)
= – [ -0.4669 + (-0.5218)]
= – (-0.9887)
= 0.9887
Male
= – [2/18 log2 (2/18) + 9/18 log2 (9/18) + 3/18 log2 (3/18) + 4/18 log 2 (4/18)]
= – [(-0.3552) + (-0.5) + (-0.4308) + (-0.4822)]
= 1.7652
Female
= – [5/14 log (5/14) + 2/14 log2 (2/14) + 5/14 log (5/14) + 2/14 log2 (2/14)]
= – [-0.5305 + (-0.0363) + (-0.5305) + (-0.0363)]
= 1.1336
Weighted Average
= (18/32 x 1.7652) + (14/32 x 1.1336)
= 0.99 + 0.50
= 1.49
III. Background attribute using multiway split
Class/Background
B40
M40
T20
Arts
3
4
0
Engineering
2
4
2
Science
0
1
9
Others
5
2
0
Total
10
11
11
Overall
= – [10/32 log (10/32)] + 11/32 log2 (11/32) + 11/32 log2 (11/32)
= – [-0.5244 + (-0.5296) + (-0.5296)]
= 1.5836
B40
= – [3/10 log2 (3/10) + 2/10 log2 (2/10) + 0 + 5/10 log2 (5/10)]
= – [-0.5211 + (-0.042) + (-0.5)]
= 1.0631
M40
= – [4/11 log (4/11) + 4/11 log (4/11) + 1/11 log2 (1/11) + 2/11 log2 (2/11)]
= – [ -0.5307 + (-0.5307) + (-0.3145) + (-0.4472)
= 1.8231
T20
= – [2/11 log2 (2/11) + 9/11 log2 (9/11)
= – (-0.4472 + (-0.2369))
= 0.6841
Weighted Average
= (10/32 x 1.0631) + (11/32 x 1.8231) + (11/32 x 0.6841)
= 0.3322 + 0.6267 + 0.2352
= 1.194
IV. English attribute using multiway splits (<= 64, >= 65 and < 80, and >= 80)
Class/Marks
<= 64
>= 65 and < 80
>= 80
Arts
2
1
4
Engineering
5
5
1
Science
5
2
1
Others
2
0
4
Total
14
8
10
Split <= 64
= – [(2/14 log2 (2/14) + 5/14 log2 (5/14) + 2/14 log2 (2/14) + 5/14 log2 (5/14)]
= – [-0.4011 + (-0.4011) + (-0.5305) + (-0.5305)
= 1.8632
Split >= 65 and <80
= – [1/8 log2 (1/8) + 5/18 log2 (5/18) + 2/8 log2 (2/8)]
= – [ -0.375 + (-0.4238) + (-0.5)]
= 1.2988
Split >= 80
= – [4/10 log2 (4/10) + (1/10 log2 (1/10) + 4/10 log2 (4/10) + (1/10 log2 (1/10)]
= – (-0.5288 + (-0.5288) + (-0.3322) + (-0.3322)
= 1.722
Weighted Average
= (14/32 x 1.8632) + (8/32 x 1.2988) + (10/32 x 1.722)
= 0.8152 + 0.3247 + 0.5381
= 1.678
V. Mathematics attribute using multiway splits (<= 64, >= 65 and < 80, and >= 80)
Class/Marks
<= 64
>= 65 and < 80
>= 80
Arts
2
2
3
Engineering
4
2
5
Science
1
2
5
Others
3
3
0
Total
10
9
13
Split <= 64
= – [2/10 log2 (2/10) + 4/10 log2 (4/10) + 1/10 log2 (1/10) + 3/10 log2 (3/10)]
= – [ -0.4644 + (-0.5288) + (-0.3322) + (-0.5211)
= 1.8465
Split >=65 and <80
= – [2/9 log2 (2/9) + 2/9 log2 (2/9) + 2/9 log2 (2/9) + 3/9 log2 (3/9)
= -(-0.4822) + (-0.4822) + (-0.4822) + (-0.5211)
=1.9749
Split >= 80
= – [3/13 log2 (3/13) + 5/13 log2 (5/13) + 5/13 log2 (5/13)]
= [ -0.4882 + (-0.5302) + (-0.5302)]
= 1.5486
Weighted Average
= (10/32 x 1.8465) + (9/32 x 1.9749) + (13/32 x 1.5486)
= 0.5770 + 0.5554 + 0.6291