Showing posts with label data points. Show all posts
Showing posts with label data points. Show all posts

Friday, September 20, 2024

How SVM Adjusts with New Data Points

Support Vector Machines (SVM) are often used to classify data by finding the best boundary (hyperplane) that separates different classes. But how does SVM deal with new data points after it has already been trained? Let’s break this down with a simple example.

#### 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.

Featured Post

How HMT Watches Lost the Time: A Deep Dive into Disruptive Innovation Blindness in Indian Manufacturing

The Rise and Fall of HMT Watches: A Story of Brand Dominance and Disruptive Innovation Blindness The Rise and Fal...

Popular Posts