Preliminary Theory Concepts
Entropy is the measure of the homogenity of the set of example.Entropy is 0 when all the cases of the sample set belong to one particular class which means totally random classification.Entropy is 1 when all the classes contain equal number of cases of the sample set which means perfectly classified.
The formula used to calculate the same is Entropy(S) = -pplog2pp - pnlog2pn where -
pp dentoes the proportion of examples belonging to class 1 in S
pndentoes the proportion of negative examples belonging to class 2 in S
Similarly it can be extended to n number of classes
Information Gain measures the exepected reduction in entropy caused by partitioning the samples according to a particular attribute.
Information Gain = Entropy before - Entropy After
a.
Total number of samples - 10
Proportion of samples preferring McDonalds:pm -
Proportion of samples preferring Burger King:pb -
Proportion of samples preferring Wendys:pw -
Thus the entropy referring to the above three classes will be -pmlog2pm - pblog2pb -pwlog2pw
Substituting the above values the entropyBeforeSplit is: -log2- log2 -log2
b.
Total number of samples having chicken as meal preference : 4
When chicken is the meal preference the proprtion of people going to Mcdonalds : pcm =
When chicken is the meal preference the proprtion of people going to Burger King : pcb=
When chicken is the meal preference the proprtion of people going to Wendys : pcw =
entropyChicken = -pcmlog2pcm - pcblog2pcb -pcwlog2pcw
Substituting the above values the entropyChicken is: -log2- log2 -log2
c.
Information Gain = Entropy_before_split - Entropy_after_split
Entropy_before_split = X
Entropy_after_split = -(Proprtion of consumers preferring pepsi)* (entropy for drink Preference Pepsi) - (Proprtion of consumers preferring coke)* (entropy for drink Preference c)
Entropy_after_split = ( * P) + ( * C)
Information gain for Drink Preference : X - ( * P) - ( * C)
fish F 5. Consider the following dataset where the decision attribute is restaurant: mealPreference gender drinkPreference...
Problem 4. Consider f(x) = x5+ x4 + 2x3 + 3x2 + 4x + 5 ∈ Q[x] and our goal is to determine if f is irreducible over Q. We compute f(1), f(−1), f(5), f(−5) directly and see that none of them is zero. By the Rational Roots Theorem, f has no root in Q. So if f is reducible over Q, it cannot be factored into the product of a linear polynomial and a quartic polynomial (i.e. polynomial of...