Bayes Algorithm: Ex1
Bayes Algorithm: Ex1
Bayes algorithm:
Ex1.
Ex2.
Outlook Temp Humidity Windy Play
Rainy 3 2 Cool 3 1
Sunny 2/9 3/5 Hot 2/9 2/5 High 3/9 4/5 False 6/9 2/5 9/14 5/14
Overcast 4/9 0/5 Mild 4/9 2/5 Normal 6/9 1/5 True 3/9 3/5
Consider the training examples shown in Table for a binary classification problem
a) Compute the Gini index for the overall collection of training examples.
b) Compute the Gini index for the Customer ID attribute.
c) Compute the Gini index for the Gender attribute.
d) Compute the Gini index for the Car type attribute using multiway split.
e) Compute the Gini index for the Shirt Size using multiway split.
f) Which attribute is better, Gender, Car Type or Shirt size.
Ex.2:
Consider the training examples shown in Table for a binary classification problem
a) What is the entropy of this collection of training examples with respect to the positive class?
b) What is the best split (among a1, a2, a3) according to the information gain?
c) What is the best split (between a1 and a2) according to the Gini index?
3. KNN
Classify the data point x = 0.5 according to its 1-, 3-, 5-, and 9-nearest neighbors using
majority vote.
4. Association rules algorithm
Ex1:
a) compute the support for itemsets {e}, {b,d}, and {b, d, e} by treating each transaction ID
as a market basket.
b) Use the results in part (a) to compute the confidence for the association rules {b,d}→
{e} and {e} → {b,d}.
Ex2: