ML0051 Linear SVM

Can you explain the key concepts behind a Linear Support Vector Machine?

Answer

A Linear Support Vector Machine (Linear SVM) is a classifier that finds the optimal straight line (hyperplane) separating two classes by maximizing the margin between them. It relies on a few critical points (the support vectors) and offers strong generalization, especially on linearly separable data.

(1) Hyperplane: The decision boundary that separates data points of different classes.
(2) Margin: The distance between the hyperplane and the nearest data point of each class; the SVM maximizes it.
(3) Support Vectors: The points lying closest to the hyperplane; they alone define it: moving any other point changes nothing.
(4) Objective: Maximize the margin while minimizing classification error (hard margin forbids error; soft margin prices it in).

Hard margin SVM with two separable point clouds, solid decision boundary, two dashed margin lines, and circled support vectors

Figure 1: Hard-margin SVM: the solid hyperplane w^T x + b = 0 sits midway between the dashed margins w^T x + b = \pm 1, and only the circled support vectors touch the margin: they alone determine the boundary.

Mathematical Formulation:
f(\mathbf{x}) = \mathbf{w}^\top \mathbf{x} + b
\hat{y} = \mathrm{sign}(\mathbf{w}^\top \mathbf{x} + b) = \mathrm{sign}(f(\mathbf{x}))
\min_{\mathbf{w}, b} \; \frac{1}{2} \|\mathbf{w}\|^2
\text{subject to } y_i(\mathbf{w}^\top \mathbf{x}_i + b) \geq 1 \quad \text{for all } i

Where:

  • \mathbf{x} is the input feature vector, \mathbf{w} the weight vector, b the bias; \hat{y} is the predicted label.
  • \mathrm{sign}(\cdot) returns +1 if its argument is ≥ 0 and −1 otherwise; y_i \in \{-1, +1\} is the true label of point \mathbf{x}_i.
  • Minimizing \frac{1}{2}\|\mathbf{w}\|^2 under those constraints is the hard-margin objective: since the margin width is 2 / \|\mathbf{w}\|, small \|\mathbf{w}\| means a wide margin.

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *