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 Problem
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 TDAT' available on webcourse. The first column represents our binary response variable and the last two columns our predictors.
a The file svmsepppy 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 boldsymbolalpha 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 mathbfzprime
c Next, implement the SVM dual problem using the Gaussian kernel. This is a case where the data is nonlinear and nonseparable. Report the values of boldsymbolalpha number of support vectors on the margin, number of support vectors NOT on the margin, and b
d Implement the prediction code for predicting a new observation. Use your code to predict the new observation mathbfzprime
Problem
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 c with the quantum kernel instead of the Gaussian kernel. Report the values of boldsymbolalpha 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 mathbfzprime
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
