Professional Documents
Culture Documents
SVM Report
SVM Report
SVM Report
Anchitya Kumar
ASSIGNMENT_4_LAB REPORT
Decision Boundaries
Two Linear Support Vector Classifier (LinearSVC) models were applied, one on the
original
data and the other utilizing {StandardScaler} to scale the data. Plotting the decision
boundaries for each model side by
side
has 200 data points, 15%–20% noise, and two classes that form crescent
moon shapes. The
1. Put SVM models into practice using the linear, polynomial, and RBF
kernels.
Linear Kernel:
Polynomial Kernel:
patterns.
3) . RBF Kernel:
1. Linear Kernel: The linear kernel is appropriate for datasets with well-separated
classes. However, in the unscaled Iris dataset example, it struggles to capture
the curved decision boundary accurately. Feature scaling becomes crucial in this
case, highlighting the importance of preparing the data properly.
2. Polynomial Kernel: The polynomial kernel offers more flexibility than the
linear kernel, allowing it to model more complex decision boundaries. In the
make_moons dataset example, the polynomial kernel SVM fits a polynomial
decision boundary, which is particularly beneficial for datasets exhibiting curved
patterns.
3).RBF Kernel (Radial Basis Function): The RBF kernel stands out as the most
versatile option among the three. It excels at capturing intricate and nonlinear
decision boundaries. In the make_moons dataset, the RBF kernel SVM provides a
smooth, curvilinear decision boundary that adapts well to complex datasets with
non-linear structures. Its adaptability enables it to handle a wide range of
decision boundaries, both simple and intricate.
Interplay of Hyperparameters:
The interplay between the gamma (γ) and C hyperparameters in the RBF kernel
SVM plays a pivotal role in balancing model bias and variance:
- Gamma (γ): A higher γ value makes the decision boundary more sensitive to
individual data points, resulting in a complex and intricately shaped boundary.
Conversely, a lower γ value creates a smoother, less complex boundary. In the
visualizations, you can discern that elevated γ values lead to intricate decision
boundaries, which, if not managed properly, can result in overfitting.
The dynamic interplay between γ and C allows you to strike a balance between
model bias and variance. In cases where the data is relatively clean and well-
structured, opting for a higher C and a moderate γ can create a hard margin.
However, when dealing with noisy data or aiming for superior generalization, you
may lean towards lower C and γ values.
Generalization vs. Overfitting:
Ensuring that the RBF kernel SVM generalizes effectively while fine-tuning
hyperparameters is of utmost importance. Strategies to promote generalization
and mitigate overfitting include: