Lab 07
Lab 07
Lab Session: 07
Notes:
1. Please read the assignment notes carefully and comply to the guidelines provided.
2. Code should be checked into the GitHub and the report to TurnItIn. Once done, please
submit your assignments in Teams.
3. Code non-availability in GitHub shall be marked as zero.
4. Any content copy (statements, figures, codes etc.) from anywhere shall attract a penalty of
10 marks. If you obtain content from anywhere for illustration purposes, please cite the
source to avoid penalty.
5. Snapshot / screenshot of code and results not allowed in the report. You may copy content
from your own code & results and add to the report.
6. Provide data, code snippets or illustrations to support your answer, as applicable.
Refer: https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html
>>> clf.support_vectors_
A2. Test the accuracy of the SVM using the test set obtained from above exercise. Following code for
help.
This shall generate the accuracy report of classification done for you. Perform classification for a
given vector using clf.fit(<<test_vect>>). This shall produce the class of the test vector (test_vect is
any feature vector from your test set).
A3. Use the Predict function of SVC classifier to study the output values of the classifier. Relate the
output value to the class value predicted. Test the accuracy of the SVM, with your own logic of class
determination and comparing against the class labels, using the test set obtained from above
exercise. Following code for help.
>>> clf.predict(X_test)
A4. Experiment with various kernel functions (‘linear’, ‘poly’, ‘rbf’ & ‘sigmoid’) to train and test the
accuracy of the models.
Optional Section:
O1. If your dataset is a multiclass classification problem, try the SVM for multi-class model building
on your dataset.
O2. If your dataset is a regression problem, try the support vector regressor.
Report Assignment:
1. Search to identify and download more relevant papers for your project. Study them and
update the Literature survey section as appropriate.
2. Using the experiments conducted in this lab exercise and results obtained, update the
methodology, results & discussions and conclusion portions of your report.