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

Support Vector Machine Lab Report

This lab report focuses on the Support Vector Machine (SVM) algorithm, detailing its theory, implementation, and results. SVM is a supervised learning method used for classification and regression, aiming to find an optimal hyperplane for data separation, utilizing kernel functions for non-linearly separable data. The report discusses challenges faced during implementation, such as kernel selection and feature scaling, while highlighting the algorithm's accuracy in classification tasks.

Uploaded by

Ismat Zerin
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)
3 views2 pages

Support Vector Machine Lab Report

This lab report focuses on the Support Vector Machine (SVM) algorithm, detailing its theory, implementation, and results. SVM is a supervised learning method used for classification and regression, aiming to find an optimal hyperplane for data separation, utilizing kernel functions for non-linearly separable data. The report discusses challenges faced during implementation, such as kernel selection and feature scaling, while highlighting the algorithm's accuracy in classification tasks.

Uploaded by

Ismat Zerin
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

Lab Report on Support Vector Machine (SVM)

Lab Report Title: Support Vector Machine (SVM)

Name: Ismat Zerin

ID: 231071034

Semester: 6th

Batch: 32

Course Title: Machine Learning Sessional

Course Code: CSE-3204

Department: Computer Science and Engineering

Name of the Algorithm


Support Vector Machine (SVM)

Theory
Support Vector Machine (SVM) is a supervised machine learning algorithm used for classification
and regression tasks. The main objective of SVM is to find an optimal hyperplane that separates
data points of different classes with the maximum margin. The data points closest to the hyperplane
are called support vectors and play a key role in defining the decision boundary.

For datasets that are not linearly separable, SVM uses kernel functions to transform the data into a
higher-dimensional space, making separation possible. Common kernel functions include Linear and
Radial Basis Function (RBF). SVM is known for its accuracy and robustness in classification
problems.

Code
from sklearn import datasets
from sklearn.model_selection import train_test_split
from [Link] import SVC
from [Link] import accuracy_score
data = datasets.load_iris()
X = [Link]
y = [Link]

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

model = SVC(kernel='linear')
[Link](X_train, y_train)

y_pred = [Link](X_test)
print("Accuracy:", accuracy_score(y_test, y_pred))

Discussion
While implementing the Support Vector Machine algorithm, some difficulties were encountered in
selecting the appropriate kernel and tuning parameters such as the regularization value.
Additionally, SVM is sensitive to feature scaling, which required proper data preprocessing. Despite
these challenges, the algorithm achieved accurate and reliable classification results, demonstrating
the effectiveness of SVM for classification tasks.

You might also like