68 Chapter 5 Classification: Alternative Techniques
Cost Matrix + −
+c(+,+) + β c(+,−)+β
20. Consider the task of building a classifier from random data, where the at-
tribute values are generated randomly irrespective of the class labels. Assume
the data set contains records from two classes, “+” and “−.” Half of the data
set is used for training while the remaining half is used for testing.
(a) Suppose there are an equal number of positive and negative records in
the data and the decision tree classifier predicts every test record to be
positive. What is the expected error rate of the classifier on the test
data?
(b) Repeat the previous analysis assuming that the classifier predicts each
test record to be positive class with probability 0.8 and negative class
with probability 0.2.
(c) Suppose two-thirds of the data belong to the positive class and the
remaining one-third belong to the negative class. What is the expected
error of a classifier that predicts every test record to be positive?
(d) Repeat the previous analysis assuming that the classifier predicts each
test record to be positive class with probability 2/3 and negative class
with probability 1/3.
21. Derive the dual Lagrangian for the linear SVM with nonseparable data where
the objective function is
f(w)=w2
2+C
N
i=1
ξi2.
i=1
2
i,j
i