CS/ECE/ME532 Assignment 1


Category: You will Instantly receive a download link for .zip solution file upon Payment


5/5 - (1 vote)

1) A binary classifier decides whether data is from one of two classes, labeled 1 and -1.
In this problem the data is described by two features x1 and x2 and the classification
decision is made as follows. The class with label 1 is decided if x1a1 + x2a2 > b while
the class with label -1 is decided when x1a1 + x2a2 < b. Here a1, a2, and b are given
real numbers.

a) The decision boundary is the set of {x1, x2} that satisfy x1a1 + x2a2 = b. Thus,
we may assign the label to the data using the sign of y = x1a1 + x2a2 − b since
label 1 is decided if y > 0 and label -1 is decided if y < 0. That is, the label may
be obtained as sign{y}. Express y as an inner product of a vector x containing
the features and w containing weights, that is, write y = x
T w.

b) Let x2 be the vertical axis and x1 be the horizontal axis. Show that the decision
boundary y = 0 is a straight line. Find the slope and intercept with the vertical
axis as a function of a1, a2, b.

c) You classify n data samples using sign{y} where y =


= Xw. Suppose
n = 4 and the features for the 4 data samples are 1 : (0, 0.4), 2 : (0.2, 0.1), 3 :
(0.5, 0.6), 4 : (0.9, 0.8). Write out the matrix X.

d) Suppose a1 = 1, a2 = 2, and b = 1. Sketch the decision boundary in the x1-x2
plane assuming x2 is the vertical axis and x1 is the horizontal axis. Graph the
four data samples from the previous part and classify them.

e) Download and run the linear classifier script. This script classifies 5000 examples
of (randomly generated) data consisting of two features using the linear classifier.
Save the figure and include it in your submission. Describe the decision boundary
you observe using a sentence.

f) Change the classifier weights to w = [1.6 2 − 1.6]T
. Rerun the scrip. Include
the figure in your pdf file. Briefly describe how the change in the weights changed
the decision boundary.