Homework 4 QA
Name
Institution
, COMPUTER SCIENCE 2
Homework 4 QA
1. For a binary classification, describe the possible values of entropy. On what conditions
does entropy reach its minimum and maximum values?
Entropy has two value, 0 and 1. A perfect model has a value of 0 whereas 1 signifies a
high loss value. To attain a maximum value in entropy, the random variable should be uniformly
distributed while to obtain a minimum value, the random value should be constant.
2. In a decision tree, how does the algorithm pick the attributes for splitting?
Splitting means diving a node into sub nodes. According to Rajesh (2018), algorithms
pick the attribute for splitting by either finding out the statistical significance between the
differences between sub-nodes and parent node when performing two or by calculating the
entropy of parent node or by calculating the variance for each node. The attributes to spilt are
chosen from the lowest values compared to parent node.
3. John went to see the doctor about a severe headache. The doctor selected John at random
to have a blood test for swine flu, which is suspected to affect 1 in 5,000 people in this
country. The test is 99% accurate, in the sense that the probability of a false positive is
1%. The probability of a false negative is zero. John's test came back positive. What is
the probability that John has swine flu?
Let P(D) be the probability John has swine flue
Let P(T) be the probability of a positive test.
According to Bayes theorem
P(D|T) = P(T|D) P(D) / P(T)=
P(D|T) = P(T|D) P(D) / (P(T|D) P(D) + P(T|ND) P(ND))