# How does SVM classify when test data point lies between the 2 margins

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?

• 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. Mar 28, 2021 at 13:46
• @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? Mar 28, 2021 at 14:29
• 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$. Mar 28, 2021 at 14:42
• @Zhanxiong I think you can convert your comment to an answer Mar 28, 2021 at 14:48
• @gunes I am happy to do that when I get time. Mar 29, 2021 at 14:11

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.