Unlock access to all the studying documents.
View Full Document
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:
Based on the training data furnished, compute the Entropy for each of the following cases:
I. The overall collection of the training data
= – [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
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
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)
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)
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