0% found this document useful (0 votes)
17 views2 pages

Lab 07

The document provides instructions for a lab assignment on support vector machines, including training an SVM classifier on a dataset, getting the support vectors, testing the accuracy on a test set, using the predict function to study outputs, and experimenting with different kernel functions. Students are asked to conduct the SVM experiments, update their report with the results, and search for additional relevant papers to study.

Uploaded by

6technoviper9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Lab 07

The document provides instructions for a lab assignment on support vector machines, including training an SVM classifier on a dataset, getting the support vectors, testing the accuracy on a test set, using the predict function to study outputs, and experimenting with different kernel functions. Students are asked to conduct the SVM experiments, update their report with the results, and search for additional relevant papers to study.

Uploaded by

6technoviper9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Subject: 19CSE305

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.

Please use the data associated with your own project.

Refer: https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html

Main Section (Mandatory):


A1. Train a support vector machine using the training set obtained from above exerciseyou’re your
dataset has multiple classes, take any two classes for this exercise. Following code for help:

>>> import numpy as np


>>> from sklearn import svm
>>> clf = svm.SVC()
>>> clf.fit(X_train, y_train)

Get the support vectors and study them to understand them.

>>> clf.support_vectors_

A2. Test the accuracy of the SVM using the test set obtained from above exercise. Following code for
help.

>>> clf.score(X_test, y_test)

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy