RBF Kernel in SVM
RBF Kernel in SVM
The RBF (Radial Basis Function) kernel is commonly used in SVM to handle non-linearly separable data.
Instead of using a straight-line decision boundary, the RBF kernel helps SVM create curved and complex decision boundaries.
1. RBF Kernel Formula
The RBF kernel is computed as:
It calculates the similarity between two data points.
2. Parameters and Terms in the Formula
| Symbol | Meaning |
|---|---|
| First data point | |
| Second data point | |
| Squared Euclidean distance between the points | |
| Controls the influence range of a data point | |
| Exponential function | |
| Kernel similarity value |
3. How Does the RBF Kernel Compute Similarity?
Let us take two points:
and
Suppose:
Step 1: Calculate the Difference
Step 2: Calculate the Squared Euclidean Distance
Step 3: Multiply by
Step 4: Apply the Exponential Function
Therefore, the similarity between these two points is approximately:
4. Interpretation of the Kernel Value
The RBF kernel value lies between:
If two points are identical
Then:
Therefore:
So, identical points have maximum similarity.
If two points are far apart
The distance becomes large:
Therefore:
So:
5. The Role of
The parameter:
controls how quickly similarity decreases as distance increases.
Small
Suppose:
The similarity decreases slowly.
Therefore, even relatively distant points can influence each other.
Result:
Large
Suppose:
The similarity decreases quickly.
Only nearby points strongly influence each other.
Result:
6. Example Showing the Effect of
Suppose the squared distance between two points is:
Case 1: Small
Case 2: Large
Comparison
| Kernel Value | Meaning | |
|---|---|---|
| 0.1 | 0.670 | Points still have considerable similarity |
| 1 | 0.018 | Points have very little similarity |
Thus:
7. Another Important Parameter:
In an SVM using an RBF kernel, another important parameter is:
The parameter controls the penalty for classification errors.
Small
The model allows more classification errors.
It generally produces a smoother decision boundary.
Large
The model strongly tries to classify all training points correctly.
It may produce a more complex boundary and can lead to overfitting.
8. Difference Between and
This is an important distinction for students.
| Parameter | Controls |
|---|---|
| Penalty for classification errors | |
| Influence range of each data point |
Easy way to remember:
9. How RBF Kernel is Used in SVM
During SVM training, the kernel function is computed between training points.
Conceptually:
and so on.
These values form a kernel matrix.
For example:
The SVM uses these similarity values to find the support vectors and construct a non-linear decision boundary.
10. Simple Computational Flow
You can explain the process to students as:
Two data points ↓ Calculate distance between them ↓ Square the distance ↓ Multiply by -γ ↓ Apply exponential function ↓ Get similarity value K(xi, xj) ↓ SVM uses similarities to find a non-linear decision boundary
⭐ Summary
The RBF kernel is computed as:
Comments
Post a Comment