Académique Documents
Professionnel Documents
Culture Documents
.
(c) Run the perceptron algorithm for x
3
with learning rate 0.05 using as initial estimates for w
[1, 1, 0.5]
.
(d) Comment on the results.
2. (a) Generate a set X
1
of N
1
= 200 data vectors, such that the rst 100 vectors stem from class
1
which is modeled by the Gaussian distribution with mean m
1
= [0, 0, 0, 0, 0]
.
Both distributions share the following covariance matrix:
S =
x > (<)0
Compute the probability of error. Compare the results with those obtained in step 1.
(c) Repeat the previous steps, rst with X
2
replaced by a set X
3
containing N
3
= 10, 000 data
vectors and then with a set X
4
containing N
4
= 100, 000 data vectors. Both X
3
and X
4
are
generated using the prescription adopted for X
1
. Comment on the results.
3. In the 2-dimensional space, we are given two equiprobable classes, which follow Gaussian dis-
tributions with means m
1
= [0, 0]
and m
2
= [1.2, 1.2]
y +)
n
for (n, ) = (5, 0) and (3, 1).
Draw conclusions.
(e) Design the SVM classiers using the radial basis kernel function with = 1.5 and using the
polynomial kernel function with n = 3 and = 1.
(f) Comment on the reproducibility of your answers.
5. (a) Generate a 2-dimensional data set X
1
(training set) as follows. Consider the nine squares
[i, i + 1] [j, j + 1], i = 0, 1, 2, j = 0, 1, 2 and draw randomly from each one 30 uniformly
distributed points. The points that stem from squares for which i + j is even (odd) are
assigned to class +1 (-1) (like the white and black squares on a chessboard). Plot the data
set and generate an additional data set X
2
(test set) following the prescription used for X
1
(as in the previous problem, set the seed for rand at 0 for X
1
and 100 for X
2
).
(b) i. Design a linear SVM classier. Compute the training and test errors and count the
number of support vectors.
ii. Employ the previous algorithm to design nonlinear SVM classiers, with radial basis
kernel functions. Use = 1, 1.5, 2, 5. Compute the training and test errors and count
the number of support vectors.
iii. Repeat for polynomial kernel functions, using n = 3, 5 and = 1.
(c) Draw your conclusions regarding the efcacy of the SVM, and the reproducibility of your
results.
6. (a) i. Generate a data set X
1
consisting of 400 2-dimensional vectors that stem from two
classes. The rst 200 stem from the rst class, which is modeled by the Gaussian
distribution with mean m
1
= [8, 8]
0.3 1.5
1.5 9.0
and m
2
= [1, 0]
.
(c) Compare the results obtained and draw conclusions.
(d) Apply Fishers linear discriminant analysis on the data set X
2
and compare the results
obtained which those from the analysis above.
c SBN, 2014, IIT-Bombay 2