Classification of Non-Linear Data using SVM with RBF Kernel
Experiment
Classification of Non-Linear Data using SVM with RBF Kernel
🎯 Objective
To implement Support Vector Machine (SVM) with RBF kernel to classify non-linearly separable data and visualize the decision boundary.
📚 Theory
Some datasets cannot be separated using a straight line. Such data is called non-linearly separable.
🔹 Solution: Kernel Trick
SVM uses a kernel function to map data into a higher-dimensional space where it becomes linearly separable.
🔹 RBF Kernel (Radial Basis Function)
The most commonly used kernel:
Where:
- controls how far influence of a point reaches
- Small γ → smooth boundary
- Large γ → complex boundary
📊 Dataset
We generate a non-linear circular dataset using make_circles:
- Inner circle → Class 0
- Outer circle → Class 1
🔬 Algorithm / Procedure
- Import required libraries
- Generate non-linear dataset
- Train SVM with RBF kernel
- Plot dataset
- Plot decision boundary
- Analyze results
💻 Program
📈 Output
- Circular dataset plotted
- Non-linear decision boundary (curved line)
- Margins shown
- Support vectors highlighted
✅ Result
The SVM with RBF kernel successfully classified non-linear data by creating a non-linear decision boundary.
A non-linear decision boundary was observed, demonstrating the effectiveness of the kernel trick.The support vectors were identified and visualized; these points lie closest to the decision boundary and play a crucial role in defining it.
The margin boundaries were also visualized, showing the region of separation between classes.

Comments
Post a Comment