SVM begins with a geometric choice: which separator is safest?
Before optimization, SVM is a simple visual idea: separate the classes while staying as far as possible from the closest points.
Many separating lines
First question
If all these lines classify the training data correctly, which one feels most reliable?
SVM prefers the boundary that has the largest safety gap from nearby points.
Hyperplane equation
Boundary question
How do we write a separating line in a way that also works for many dimensions?
In two dimensions, the boundary can be written as:
In many dimensions:
The vector \(w\) controls orientation. The number \(b\) shifts the boundary.
Prediction comes from which side of the hyperplane the point lies on.
Prediction by sign
Sign question
If \(w^Tx+b\) is positive for a point, which class should it belong to?
| Score | Prediction | Meaning |
|---|---|---|
| \(f(x)>0\) | \(+1\) | point is on the positive side |
| \(f(x)<0\) | \(-1\) | point is on the negative side |
| \(f(x)=0\) | on boundary | model is exactly undecided |
Margin and support vectors
Safety question
Should a correctly classified point very close to the boundary be treated as fully safe?
SVM wants a confident separation. The closest points determine the safety gap. These closest points are support vectors.
SVM vs logistic regression
Comparison question
How is SVM different from logistic regression if both can learn a linear boundary?
| Model | Main focus | Output style |
|---|---|---|
| Logistic Regression | learn probabilities using log loss | probability-like output |
| SVM | maximize margin using hinge loss | decision score; probabilities need extra calibration |