(5/5)

If you have any questions, please contact me.

Q1 Given a dataset of two positive points (red points): [6, 2]T , [6, 4]T , and two negative points (green points): [2, 4]T , [3, 6]T , as shown in figure below, the problem of a linearly separable SVM can be formulated as the following form:

minx

1 xT Qx + pT x 2

subject to Gx ≤ h (1)

Write down the values of Q, p, G, and h.

Q2 Modify the provided example code “example-code.py” to solve the linearly separable SVM problem in Q1 and output the following values:

1. The values of w and b that decide the separating line w.x + b = 0.

2. The margin size.

3. The support vectors.

4. Predict the class labels of the points:

[3, 5]T , [3, 4]T , [4, 6]T , [5, 4]T , [5, 2]T , [5, 6]T .

Q3 Given a dataset of three positive points (red points): [3, 5]T , [5, 3]T , [6, 6]T , and two negative points (green points): [5, 6]T , [6, 5]T , as shown in figure below, the problem of a linearly non-separable SVM can be formulated as the following form:

minx

1 xT Qx + pT x 2

subject to Gx ≤ h (2)

Write down the values of Q, p, G, and h.

Q4 Set the trade-off parameter C = 1. Modify the provided example code “example-code.py” to solve the

linearly non-separable SVM problem in Q3 and output the following values:

1. The values of w and b that decide the separating line w.x + b = 0.

2. The margin size.

3. The support vectors.

4. Predict the class labels of the points:

[3, 4]T , [3, 6]T , [4, 3]T , [4, 5]T , [5, 4]T , [5, 2]T , [5, 6]T , [6, 4]T , [6, 7]T , [7, 5]T , [7, 6]T .

Q5 Set the trade-off parameter C = 1000. Use the same dataset in Q3 and the basis functions ϕ(x) = [x1, x2, x2, x2, x1 • x2]T , where x = [x1, x2]T . Further modify the code implemented for Q4 to train

a nonlinear SVM model and output the following values:

1. The values of w and b that decide the separating line w.ϕ(x) + b = 0.

2. The margin size.

3. The support vectors.

4. Predict the class labels of the points:

[3, 4]T , [3, 6]T , [4, 3]T , [4, 5]T , [5, 4]T , [5, 2]T , [5, 6]T , [6, 4]T , [6, 7]T , [7, 5]T , [7, 6]T .

(5/5)

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Get Free Quote!

386 Experts Online