0% found this document useful (0 votes)
4 views1 page

Implementing SVM for Classification in Python

This document outlines an experiment to implement and study the Support Vector Machine (SVM) algorithm for classification using Python. It details the necessary software, key concepts of SVM, its applications, and the algorithmic steps involved in executing the experiment. The aim is to analyze the performance of SVM on a standard dataset.

Uploaded by

g48552392
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)
4 views1 page

Implementing SVM for Classification in Python

This document outlines an experiment to implement and study the Support Vector Machine (SVM) algorithm for classification using Python. It details the necessary software, key concepts of SVM, its applications, and the algorithmic steps involved in executing the experiment. The aim is to analyze the performance of SVM on a standard dataset.

Uploaded by

g48552392
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

Experiment 5

Support Vector Machine (SVM)


Aim
To implement and study the Support Vector Machine (SVM) algorithm using Python for
classification, and to analyze its performance on a standard dataset.

Apparatus / Software Requirements


Computer system with Python

Libraries: Pandas, numpy, Scikit-learn

Jupyter Notebook/Google Colab/ any Python IDE

Theory
Support Vector Machine (SVM) is a supervised learning algorithm used for both classification
and regression tasks. It is based on the concept of finding a hyperplane that best separates data
points of different classes in an n-dimensional space.
 Key Concepts:
 Hyperplane: A decision boundary that separates data points belonging to different classes.
 Support Vectors: The data points that are closest to the hyperplane and influence its position
and orientation.
 Margin: The distance between the hyperplane and the nearest data point of any class. SVM
maximizes this margin.
 Kernel Trick: Used to handle non-linear data by mapping it to higher dimensions where it
becomes linearly separable.

Applications
 Handwritten digit recognition (MNIST dataset)
 Face and object recognition
 Bioinformatics (gene classification)
 Spam email detection
 Text and sentiment classification

Algorithm

1. Start
2. Load the dataset.
3. Split the data into training and testing sets.
4. Apply feature scaling (standardization).
5. Choose a kernel function (Linear / Polynomial / RBF).
6. Train the SVM classifier using the training data.
7. Predict the results for the testing data.
8. Evaluate the model using accuracy, confusion matrix, and classification report.
9. Visualize the decision boundary (for 2D data).
10. End

Result

Conclusion

You might also like