#### Scenario: Classifying Fruits
Imagine we have trained an SVM to classify two types of fruits: apples and oranges. During training, we used the following data points:
- Apples: (1, 2), (2, 3)
- Oranges: (3, 5), (4, 4)
After training, the SVM finds a line (hyperplane) that best separates these two classes, ensuring the maximum distance (margin) between the closest points of each class (the support vectors).
#### Adding a New Data Point
Now, suppose we receive a new data point representing a fruit: (2.5, 3).
1. **Determine Position Relative to Hyperplane:**
To classify this new point, the SVM calculates its position relative to the hyperplane. It does this using the decision function:
f(x) = w · x + b
Here, w is the weight vector and b is the bias term from the trained model.
2. **Classify the New Point:**
- If f(2.5, 3) > 0, the point is classified as an apple (+1).
- If f(2.5, 3) < 0, it’s classified as an orange (-1).
3. **Adjustments (If Necessary):**
- **Correct Classification:** If the new point is classified correctly (e.g., it’s near the apples), it doesn’t change the hyperplane.
- **Misclassification:** If the new point is misclassified, it could potentially shift the hyperplane. The SVM may need to retrain using all data, including the new point, to adjust the hyperplane for better accuracy.
#### Conclusion
When a new data point is introduced, SVM checks its position relative to the established hyperplane. If the point fits well within an existing class, the system remains unchanged. However, if it challenges the current classification, retraining may be required to refine the boundary, ensuring accurate classifications for all points. This adaptability is key to maintaining performance as new data becomes available.
No comments:
Post a Comment