Calculate the entropy of each of the following datasets, where +
represents a positive instance and -, a negative instance.
D1: + + + + + + + +
D2: + + + + - - - -
D3: + + - - - - - +
D4: + + + - + + + +

This is the formula for entropy where pi is the probability of ith class/instance in total c classes/instance
a) D1: + + + + + + + +
8+, 0-
p1 = p(+) = 8/8 =1
p2 = p(-) = 0/8 = 0
Entropy= -1*log(1) - 0*log(0) = 0+0=0
b) D2: + + + + - - - -
4+, 4-
p1 = p(+) = 4/8 =0.5
p2 = p(-) = 4/8 = 0.5
Entropy= -0.5*log(0.5) - 0.5*log(0.5) = -log(0.5) = 1
c) D3: + + - - - - - +
3+, 5-
p1 = p(+) = 3/8 =0.375
p2 = p(-) = 5/8 = 0.625
Entropy= -0.375*log(0.375) - 0.625*log(0.625) = 0.53+0.42 = 0.95
d) D4: + + + - + + + +
7+, 1-
p1 = p(+) = 7/8 =0.875
p2 = p(-) = 1/8 = 0.125
Entropy= -0.875*log(0.875) - 0.125*log(0.125) = 0.168+0.375 = 0.543
To calculate the entropy of a dataset, we first need to find the proportion of positive and negative instances in the dataset, denoted by p+ and p-. Then, we can use the formula for entropy:
Entropy = -p+ * log2(p+) - p- * log2(p-)
D1: Number of positive instances = 7 Number of negative instances = 0 Total instances = 7 p+ = 7/7 = 1 p- = 0/7 = 0 Entropy = -1 * log2(1) - 0 * log2(0) = -1 * 0 - 0 * undefined = 0
D2: Number of positive instances = 4 Number of negative instances = 4 Total instances = 8 p+ = 4/8 = 0.5 p- = 4/8 = 0.5 Entropy = -0.5 * log2(0.5) - 0.5 * log2(0.5) = 1
D3: Number of positive instances = 2 Number of negative instances = 5 Total instances = 7 p+ = 2/7 p- = 5/7 Entropy = -2/7 * log2(2/7) - 5/7 * log2(5/7) = 0.863
D4: Number of positive instances = 7 Number of negative instances = 1 Total instances = 8 p+ = 7/8 p- = 1/8 Entropy = -7/8 * log2(7/8) - 1/8 * log2(1/8) = 0.543
Therefore, the entropy of D1 is 0, the entropy of D2 is 1, the entropy of D3 is 0.863, and the entropy of D4 is 0.543.
Calculate the entropy of each of the following datasets, where + represents a positive instance and...
Evaluate each of the following C++ expressions. (a) i1 + (i2 * i3) (b) i1 * (i2 + i3) (c) i1 / (i2 + i3) (d) i1 / i2 + i3 (e) 3 + 4 + 5 / 3 (f) (3 + 4 + 5) / 3 (g) d1 + (d2 * d3) (h) d1 + d2 * d3 (i) d1 / d2 - d3 (j) d1 / (d2 - d3) (k) d1 + d2 + d3 / 3 (l)...
[Question 3, 12 points total, including 3.1-3.2] (minhasbing) Consider the following matrix, d1 0 d4 0 1 1 4 6 1 3 5 2 0 0 1 0 d2 1 0 1 0 0 1 d3 1 1 0 1 1 0 0 0 0 where each column represents a document (altogether we have 4 documents, di, d2, d3 and d4), and the number of rows is the size of the universal word set. Note the first column, ie, column...
Non-excel solution please. Thank you!
SEMINAR 3: PRACTICE PROBLEMS Consider the following payoff table in which Dl through D4 represent decisions, 1 S1 through S4 represent states of nature, and the values in the cells represent profits. S1 S4 S3 -20 40 100 -50 D1 60 120 30 60 40 D2 30 10 30 40 D3 80 D4 70 -60 The optimal decision under the maximax criterion is: a) DI b) D2 c) D3 d) D4
SEMINAR 3: PRACTICE PROBLEMS...
1. (10 points) Given the following access matrix, answer the questions below: Object/ F1 Domain F3 DI Laser Printer D2 D3 D1 read switch D2 print control read execute owner write write read (a) What tasks can Di perform in the context of the table above? A. read F1, print to D2 via switch, copy read permission to other domains that access F1 B. read F2 C. write F3 D. execute F3 (b) What does the control keyword mean in...
Add some level of GUI such as an interactible window to the following program import java.util.Scanner; public class Kylie_HW5ISBN { public static void main(String[] args) { Scanner keyboard; keyboard = new Scanner (System.in); System.out.print("Please enter your 9 digit ISBN number:"); int isbn = keyboard.nextInt(); int d1 = isbn / 100000000; int d2 = (isbn % 100000000) / 10000000; int d3 = (isbn % 10000000) / 1000000; int d4 = (isbn % 1000000) / 100000; int d5 = (isbn %...
The last questions choices are customer 1,customer 2, customer
3, customer 4 demand has a shortfall
of 2000,4000,6000,8000,10000
customer 1, customer 2, customer 3, customer 4 demand of
2000,4000,6000,8000,10000
Klein Chemicals, Inc., produces a special oil-based material that is currently in short supply, Four of Klein's customers have already placed orders that together exceed the combined capacity of Klein's two plants. Klein's management faces the problem of deciding how many units it should supply to each customer. Because the four...
1. Given the following set of retrieved documents with relevance judgments TERM T1 T2 T3 T4 T5 T6 QUERY 0 0 0 2 1 0 REL D1 0 4 4 0 2 0 REL D2 0 2 6 0 0 0 REL D3 6 0 0 0 0 0 NOT REL D4 4 0 4 8 8 10 a. Calculate a new query using a factor of 1/2 for positive feedback and 1/4 for negative feedback b. Determine which documents...
Find the DTFS and sketch their spectra, Dnl and LDn for 0sk following periodic signal: S ko 1 for the x [k] = 4 cos 2Amk + 2 sin 32nk Answer: D1-D4-2 D3--j D2-j
please help! thank you!!
(sorry for so many pictures. this is the only way i could take
them without them being blurry)
Problem 6-06 Klein Chemicals, Inc., produces a special oil-based material that is currently in short supply. Four of Klein's customers have already placed orders that together exceed the combined capacity of Klein's two plants. Klein's management faces the problem of deciding how many units it should supply to each customer. Because the four customers are in different industries,...