Hard-Margin SVM
Learn how to implement and optimize the hard-margin SVM.
Hard-margin SVM
Hard-margin SVM is a type of support vector machine that aims to find the maximum margin hyperplane that perfectly separates the two classes without allowing any misclassification. It’s useful when the dataset is linearly separable and there are no outliers.
Linearly separable case
Given a binary classification dataset , where and , if a hyperplane exists that separates the two classes, the dataset is said to be linearly separable in the feature space defined by the mapping . We’ll assume for now that the dataset is linearly separable. The goal is to find the hyperplane with a maximum margin by optimizing the following objective:
The direct optimization of the above objective can be very complex. Here’s a derivation of an equivalent optimization problem which is easier to solve:
...