Question: Use python to solve Problem 3 Problem 2 In this problem, we will implement the SVM dual problem code in Python using 'CVXOPT' library. 'CVXOPT'

Use python to solve Problem 3 Problem 2
In this problem, we will implement the SVM dual problem code in Python using 'CVXOPT' library. 'CVXOPT' is a library to solve convex optimization problems as well as quadratic optimization problems. We will be using the dataset 'T11-2.DAT' available on webcourse. The first column represents our binary response variable and the last two columns our predictors.
a. The file 'svm_sep_p.py' is posted on webcourse. This code assumes that the data set is linear separable. Consequently, we will use the SVM dual problem for this question. Fill in the blanks and execute the procedure. Report the values of '\(\boldsymbol{\alpha}\)', number of support vectors, '\( w \)', and \( b \).
b. Implement the prediction code for predicting a new observation. Use your code to predict the new observation \(\mathbf{z}=(117,407)^{\prime}\).
c. Next, implement the SVM dual problem using the Gaussian kernel. This is a case where the data is nonlinear and non-separable. Report the values of '\(\boldsymbol{\alpha}\)', number of support vectors on the margin, number of support vectors NOT on the margin, and \( b_{1}\)
d. Implement the prediction code for predicting a new observation. Use your code to predict the new observation \(\mathbf{z}=(117,407)^{\prime}\).
Problem 3
In this section, we will use a different kernel for the SVM problem. The kernel used is the 'quantum kernel' often used in 'Quantum Machine Learning'.
a. Using your favorite search engine, implement a quantum kernel. Make sure to report the documentation and websites used for your implementation. Note that for this part, you are allowed to copy codes from the internet. However, you need to understand the codes and explain it in your report.
b. Use your code from problem 2(c) with the quantum kernel instead of the Gaussian kernel. Report the values of '\(\boldsymbol{\alpha}\)', number of support vectors on the margin, number of support vectors NOT on the margin, and \( b \).
c. Implement the prediction code for predicting a new observation. Use your code to predict the new observation \(\mathbf{z}=(117,407)^{\prime}\).
Use python to solve Problem 3 Problem 2 In this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!