3
$\begingroup$

I have understood that SVM classifies points using a hyperplane and a margin. A point is classified +ve when w.x + b >= 1 (margin 1) and -ve when w.x + b <= -1 (margin 2) and the decision boundary has equation as w.x + b = 0. I still don't understand, how would SVM classify a point coming from test data which lies in between the margin?

$\endgroup$
5
  • 8
    $\begingroup$ it always uses $wx + b = 0$ to do classification (i.e., if $wx + b > 0$ then class A, else class B). The soft margin concept just applies for training, i.e., the algorithm tolerates some missclassification during the training stage. $\endgroup$
    – Zhanxiong
    Commented Mar 28, 2021 at 13:46
  • 1
    $\begingroup$ @Zhanxiong So you mean to say that $wx+b>=1$ and $wx+b<=1$ is only used while training the model and classification on test data is done using $wx+b>=0$ or $wx+b<0$ conditions. Right? $\endgroup$ Commented Mar 28, 2021 at 14:29
  • $\begingroup$ That's right. Also, if you review the math details in SVM training, I don't think it's necessary to introduce the plane $wx + b = \pm 1$ explicitly. It is the slack variable $\xi_n = |t_n - (wx_n + b)| \geq 0$ that enters the optimization formulation. Of course, on the decision plane, $\xi_n = 1$. $\endgroup$
    – Zhanxiong
    Commented Mar 28, 2021 at 14:42
  • 3
    $\begingroup$ @Zhanxiong I think you can convert your comment to an answer $\endgroup$
    – gunes
    Commented Mar 28, 2021 at 14:48
  • $\begingroup$ @gunes I am happy to do that when I get time. $\endgroup$
    – Zhanxiong
    Commented Mar 29, 2021 at 14:11

1 Answer 1

0
$\begingroup$

Adding Zhanxiong's comment as an answer.

THE SVM always uses wx+b=0 to do classification (i.e., if wx+b>0 then class A, else class B). The soft margin concept just applies for training, i.e., the algorithm tolerates some misclassification during the training stage.

This means that wx+b>=1 and wx+b<=1 is only used while training the model and classification on test data is done using wx+b>=0 or wx+b<0 conditions.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.