The separating hyperplane that we are looking for is . That is is the coefficient or the slope of the separating hyperplane and is the margin.

By scaling, for the positive class, we want the closest data point (support vectors) to satisfies and for the negative data class, we want the closest data point to satisfies .

Recall from geometry class, (a dimensional case is discussed here) that the distance from a point from a plane is

Hence as a result, the distance of the closest point to the hyperplane would be and hence, the margin, that is the closest distance between the two classes would be .

We want to maximize the margin, which is equivalent to minimize which is equivalent to minimize subject to the constraints that we classify the points correctly.

Answer from Siong Thye Goh on Stack Exchange
🌐
GeeksforGeeks
geeksforgeeks.org › machine learning › using-a-hard-margin-vs-soft-margin-in-svm
Using a Hard Margin vs Soft Margin in SVM - GeeksforGeeks
July 23, 2025 - In the image, the hyperplane is defined by black solid line and the dashed lines on both the sides of hyperplane are margin. The data points falling on the margin are support vectors. The image illustrates a hard margin scenario, here there is no data point falling between the margins hence, ensuring perfect separation. Mathematically, for a linearly separable dataset, the decision function of a hard margin SVM can be expressed as:
🌐
Cornell Computer Science
cs.cornell.edu › courses › cs4780 › 2018fa › lectures › lecturenote09.html
Lecture 9: SVM
The margin, $\gamma$, is the distance from the hyperplane (solid line) to the closest points in either class (which touch the parallel dotted lines). Typically, if a data set is linearly separable, there are infinitely many separating hyperplanes. A natural question to ask is: ... SVM Answer: ...
🌐
scikit-learn
scikit-learn.org › stable › auto_examples › svm › plot_svm_margin.html
SVM Margins Example — scikit-learn 1.8.0 documentation
This is sqrt(1+a^2) away vertically in # 2-d. margin = 1 / np.sqrt(np.sum(clf.coef_**2)) yy_down = yy - np.sqrt(1 + a**2) * margin yy_up = yy + np.sqrt(1 + a**2) * margin # plot the line, the points, and the nearest vectors to the plane plt.figure(fignum, figsize=(4, 3)) plt.clf() plt.plot(xx, yy, "k-") plt.plot(xx, yy_down, "k--") plt.plot(xx, yy_up, "k--") plt.scatter( clf.support_vectors_[:, 0], clf.support_vectors_[:, 1], s=80, facecolors="none", zorder=10, edgecolors="k", ) plt.scatter( X[:, 0], X[:, 1], c=Y, zorder=10, cmap=plt.get_cmap("RdBu"), edgecolors="k" ) plt.axis("tight") x_min =
🌐
GeeksforGeeks
geeksforgeeks.org › machine learning › support-vector-machine-algorithm
Support Vector Machine (SVM) Algorithm - GeeksforGeeks
So from the above figure, we choose L2 as hard margin. Let's consider a scenario like shown below: ... Here, we have one blue ball in the boundary of the red ball. The blue ball in the boundary of red ones is an outlier of blue balls. The SVM algorithm has the characteristics to ignore the outlier and finds the best hyperplane that maximizes the margin.
Published   2 weeks ago
🌐
Medium
medium.com › @apurvjain37 › support-vector-machines-s-v-m-hyperplane-and-margins-ee2f083381b4
Support Vector Machines(S.V.M) — Hyperplane and Margins | by apurv jain | Medium
September 25, 2020 - An SVM model is basically a representation of different classes in a hyperplane in multidimensional space. The hyperplane will be generated in an iterative manner by SVM so that the error can be minimized. The goal of SVM is to divide the datasets into classes to find a maximum marginal hyperplane ...
🌐
Wikipedia
en.wikipedia.org › wiki › Support_vector_machine
Support vector machine - Wikipedia
2 days ago - In machine learning, support vector machines (SVMs, also support vector networks) are supervised max-margin models with associated learning algorithms that analyze data for classification and regression analysis. Developed at AT&T Bell Laboratories, SVMs are one of the most studied models, ...
🌐
MIT
web.mit.edu › 6.034 › wwwbob › svm-notes-long-08.pdf pdf
1 An Idiot’s guide to Support vector machines (SVMs) R. Berwick, Village Idiot
Typically, there can be lots of input features xi. Output: set of weights w (or wi), one for each feature, whose linear combination predicts the value of y. (So far, ... The margin (gutter) of a separating hyperplane is d+ + d–.
Find elsewhere
🌐
Analytics Vidhya
analyticsvidhya.com › home › svm: what makes it superior to the maximal-margin and support vector classifiers?
SVM: What makes it superior to the Maximal-Margin and Support Vector Classifiers?
October 26, 2021 - A margin passes through the nearest points from each class; to the hyperplane. The angle between these nearest points and the hyperplane is 90°. These points are referred to as “Support Vectors”. Support vectors are shown by circles in ...
🌐
Medium
medium.com › ai-enthusiast › journey-to-the-optimal-margin-a-support-vector-machine-saga-7a1a93462c50
Journey to the Optimal Margin: A Support Vector Machine Saga | by Deepankar Singh | AI-Enthusiast | Medium
November 15, 2024 - While the Perceptron could identify ... one — the one that maximizes the margin, or distance between the separating boundary and the nearest data points from each class....
🌐
DEV Community
dev.to › harsimranjit_singh_0133dc › support-vector-machines-from-hard-margin-to-soft-margin-1bj1
Support Vector Machines: From Hard Margin to Soft Margin - DEV Community
August 12, 2024 - The term "Hard Margin" comes from the fact that the algorithm requires all data points to be classified with a margin of at least 1. In other words, there are no allowances for misclassification. These strict requirements are why it's called a "hard" margin · The goal of Hard margin SVM is to maximize the margin between the two classes.
🌐
AI Mind
pub.aimind.so › soft-margin-svm-exploring-slack-variables-the-c-parameter-and-flexibility-1555f4834ecc
Soft Margin SVM: Exploring Slack Variables, the ‘C’ Parameter, and Flexibility | by Nimisha Singh | AI Mind
November 13, 2023 - So here comes the “Soft margin” addressing the shortcomings of Hard Margin SVM and allowing for more flexible and practical solutions. The Constraints [Yi (Axi1 + B xi2 + C) ≥ 1 ] in Hard Margin SVM making it inapplicable as based on constraints condition, all positive points should be above the positive hyperplane margin, and all negative data points should be below the negative hyperplane margin.
🌐
ScienceDirect
sciencedirect.com › science › article › pii › S0950705121009576
The soft-margin Support Vector Machine with ordered weighted average - ScienceDirect
November 19, 2021 - This paper deals with a cost sensitive extension of the standard Support Vector Machine (SVM) using an ordered weighted sum of the deviations of misclassified individuals with respect to their corresponding supporting hyperplanes. In contrast with previous heuristic approaches, an exact method that applies the ordered weighted average operator in the classical SVM model is proposed.
🌐
Medium
medium.com › @sruthy.sn91 › support-vector-machines-svm-unraveling-the-margin-and-the-kernel-trick-f5a9aabb2c64
Support Vector Machines (SVM): Unraveling the Margin and the Kernel Trick | by Sruthy Nath | Medium
August 16, 2023 - Mathematically, the margin is determined by the distance between the data points and the decision boundary, also known as the hyperplane. The points that are closest to the hyperplane are called support vectors — they play a pivotal role in ...
🌐
scikit-learn
scikit-learn.org › 1.5 › auto_examples › svm › plot_svm_margin.html
SVM Margins Example — scikit-learn 1.5.2 documentation
This is sqrt(1+a^2) away vertically in # 2-d. margin = 1 / np.sqrt(np.sum(clf.coef_**2)) yy_down = yy - np.sqrt(1 + a**2) * margin yy_up = yy + np.sqrt(1 + a**2) * margin # plot the line, the points, and the nearest vectors to the plane plt.figure(fignum, figsize=(4, 3)) plt.clf() plt.plot(xx, yy, "k-") plt.plot(xx, yy_down, "k--") plt.plot(xx, yy_up, "k--") plt.scatter( clf.support_vectors_[:, 0], clf.support_vectors_[:, 1], s=80, facecolors="none", zorder=10, edgecolors="k", ) plt.scatter( X[:, 0], X[:, 1], c=Y, zorder=10, cmap=plt.get_cmap("RdBu"), edgecolors="k" ) plt.axis("tight") x_min =
🌐
ScienceDirect
sciencedirect.com › topics › computer-science › maximum-margin-hyperplane
Maximum Margin Hyperplane - an overview | ScienceDirect Topics
This hyperplane is called “maximum margin hyperplane.” This leads to having the maximum distance from the nearest instance ... ) belonging to another class from the hyperplane. The hyperplane for a set of sample X is achieved via the following equation: ... 2022, Application of Machine Learning in AgricultureMohammad Reza Keyvanpour, Mehrnoush Barani Shirzad ... SVM are supervised learning techniques employed for the classification, regression, and outlier detection.
Top answer
1 of 4
42

"A geometric margin is simply the euclidean distance between a certain x (data point) to the hyperlane. "

I don't think that is a proper definition for the geometric margin, and I believe that is what is confusing you. The geometric margin is just a scaled version of the functional margin.

You can think the functional margin, just as a testing function that will tell you whether a particular point is properly classified or not. And the geometric margin is functional margin scaled by ||w||

If you check the formula:

You can notice that independently of the label, the result would be positive for properly classified points (e.g sig(1*5)=1 and sig(-1*-5)=1) and negative otherwise. If you scale that by ||w|| then you will have the geometric margin.

Why does the geometric margin exists?

Well to maximize the margin you need more that just the sign, you need to have a notion of magnitude, the functional margin would give you a number but without a reference you can't tell if the point is actually far away or close to the decision plane. The geometric margin is telling you not only if the point is properly classified or not, but the magnitude of that distance in term of units of |w|

2 of 4
10

The functional margin represents the correctness and confidence of the prediction if the magnitude of the vector(w^T) orthogonal to the hyperplane has a constant value all the time.

By correctness, the functional margin should always be positive, since if wx + b is negative, then y is -1 and if wx + b is positive, y is 1. If the functional margin is negative then the sample should be divided into the wrong group.

By confidence, the functional margin can change due to two reasons: 1) the sample(y_i and x_i) changes or 2) the vector(w^T) orthogonal to the hyperplane is scaled (by scaling w and b). If the vector(w^T) orthogonal to the hyperplane remains the same all the time, no matter how large its magnitude is, we can determine how confident the point is grouped into the right side. The larger that functional margin, the more confident we can say the point is classified correctly.

But if the functional margin is defined without keeping the magnitude of the vector(w^T) orthogonal to the hyperplane the same, then we define the geometric margin as mentioned above. The functional margin is normalized by the magnitude of w to get the geometric margin of a training example. In this constraint, the value of the geometric margin results only from the samples and not from the scaling of the vector(w^T) orthogonal to the hyperplane.

The geometric margin is invariant to the rescaling of the parameter, which is the only difference between geometric margin and functional margin.

EDIT:

The introduction of functional margin plays two roles: 1) intuit the maximization of geometric margin and 2) transform the geometric margin maximization issue to the minimization of the magnitude of the vector orthogonal to the hyperplane.

Since scaling the parameters w and b can result in nothing meaningful and the parameters are scaled in the same way as the functional margin, then if we can arbitrarily make the ||w|| to be 1(results in maximizing the geometric margin) we can also rescale the parameters to make them subject to the functional margin being 1(then minimize ||w||).

🌐
Asmquantmacro
asmquantmacro.com › 2016 › 06 › 14 › support-vector-machines-without-tears-part-1
Support Vector Machines Without Tears – Part 1 [Hard Margin]
June 26, 2016 - I decided to check out some other online content on SVM and have a stab at presenting the material in a style that is friendly to newbies. This will be a three part series with today’s post covering the linearly separable hard margin formulation of SVM. In a second post I will discuss a soft ...
🌐
IBM
ibm.com › think › topics › support-vector-machine
What Is Support Vector Machine? | IBM
November 17, 2025 - This, in turn, enables it to generalize well to new data and make accurate classification predictions. The lines that are adjacent to the optimal hyperplane are known as support vectors as these vectors run through the data points that determine the maximal margin. The SVM algorithm is widely used in machine learning as it can handle both linear and nonlinear classification tasks.
🌐
Medium
medium.com › @skilltohire › support-vector-machines-4d28a427ebd
Support Vector Machines. Introduction to margins of separation… | by skilltohire | Medium
July 28, 2020 - Support-vector machines are a type ... classification but also the non-linear classification by the help of the Kernel trick. in case of classification using SVM, we take the help of margins too separate the different available classes....