留学生作业代写do not hesitate to contact me!
WeChat:lovexc60
This is not a group assignment. Everyone is asked to complete the assignment individually.
You need to also upload your code. We will check the code to ensure that your results can be
You should use Python to finish this assignment. Juptyer notebook is allowed and encouraged.
Please download the data that will be used in this assignment here: train.csv test.csv
There are a “train.csv” file and a “test.csv” file. They are the training data and testing data,
The label (y) can take one of two classes – 0, 1;
Please use the first 4000 samples in the “train.csv” file as the training set and the remaining samples
You can use any third-party libraries to read and process data.
Question 1
Please write down the primal form of the hard-margin SVM and derive its dual formation. You are
Question 2
Please implement the training and testing algorithms of so”-margin Linear Support Vector Machine
by using CVX. Your implementation should follow the following I/O format:
Please copy the code snippet for the implementation of those two functions (You can also do this by
By se$ng C = 100, run your implementation, please report the solution of and sum of all
The assignment consists of a mix set of tasks, including derivation, question answering, coding
and result analysis. You need to provide your solutions to the corresponding sections in this quiz.
generated from your code. If your result does not match with your code, you will get 0 mark for
the relevant sections.
Data:
respectively. Inside the CSV file, the first column is the class label, the remaining columns are the
features.
In total, there are 200 features (X);
Trainset consists of 8500 samples, testset has 1500;
as validation set. All the samples in the “test.csv” file will be used as test samples.
You can use numpy in any question.
Please follow the instruction of each question to complete the relevant parts.
required to upload a PDF file (preferably in one page) to show your derivation of the dual
formulation.
from its primal form, that is,
svm_model = svm_train_primal ( data_train , label_train , regularisation_para_C )
test_accuracy = svm_predict_primal ( data_test , label_test , svm_model )
a#aching the screenshot of your code. ).
dimensions of solution, e.g., np.sum(w). (For a quick check of the correctness of your code)