Walk one of the support vector machines (SVM)

Source: Internet
Author: User
Tags svm

Set the input as $x$, the feature vector of the training set, the output is $y=\{1,-1\}$, these vectors belong to one of the two categories, assuming that these vectors are linearly divided, now to find an optimal plane (in two-dimensional time for a straight line), these eigenvectors are correctly classified, in addition, The ability to divide new input into appropriate classes.

To set the middle line equation as
$$\hat \omega x+\hat b=0$$
Well, isn't there another two boundary lines in SVM? They are the right arm of the middle line, and the distance to the middle of the line is the same, the two boundary lines exactly and the two sides of the eigenvector next to each other, their equation can be expressed as
$$\hat \omega x+\hat b=k\\
\hat \omega x+\hat b=-k$$
Why is the equal sign to the right one is $k$, one is $-k$, because they are in the middle straight distance is the same ah, just the direction is not the same, OK, here is a simple transformation, the equal sign on both sides divided by $k$, then get
$$\frac {\hat \omega x}{k}+\frac{\hat b}{k}=1\\
\frac {\hat \omega x}{k}+\frac{\hat b}{k}=-1$$
Okay, now.
$$
\omega=\frac {\hat \omega}{k} \ \
B=\frac{\hat B}{k}
$$
So, the line of two borders becomes
$$\omega x+b=1\\
\omega x+b=-1$$
and by adding the two formulas, we get the equation of the middle line.
$$\omega x+b=0$$

See, a lot of articles are talking about function interval, geometric interval, I do not say these concepts, I only talk about distance, so as not to go around around the dead end.

At this time, how to find the distance between the two boundary lines?

Simple, because the distance between the two boundaries to the middle line is equal, so just ask for a boundary line to the middle of the distance, and then multiply by 2, you get the result. How do you find the distance between the lines of a line and the middle?

This simple, the use of high school mathematics space geometry of knowledge, set p in the middle line, point Q on the boundary line, then $$\OVERRIGHTARROW{PQ} \cdot \omega = |\overrightarrow{pq}|\cdot cos (\ Theta) \cdot |\omega|=d\cdot|\omega|$$
OK, $\overrightarrow{pq} \cdot \omega$ equals how much? is equal to 1, because $\omega$ is a normal vector, point p in the middle line, point Q in the boundary line, the two linear equation subtraction, the equal sign to the left is $\OVERRIGHTARROW{PQ} \cdot \omega$, equals to the right is 1.

So what is the distance $d$ to the middle line of a borderline?

$ $d =\frac{1}{|\omega|} $$

So, the distance between the two boundary lines is $\frac{2}{|\omega|} $ up

Well, as long as you can find the maximum value of $d$ $\omega,b$ value, you can get the best classification line, of course, in the high-dimensional space, you can get the best classification super-plane!

To know, only next to the boundary line of the vector to the middle of the distance is $d$, outside the boundary line vector to the center of the distance is greater than $d$, because the two classes are $\{1,-1\}$, so must meet
$$
Y_i (\omega x_i + b \ge 1)
$$

Request $\frac{1}{|\omega|} The maximum value of $, which is equivalent to seeking $\frac{1}{2}{| | \omega| |} The minimum value of the ^2$ is written so as to convert the convex optimization problem to a convenient solution. Well, the problem is clear at this point, and can be expressed in mathematical language as
$$
\begin{align*}
Min \limits_{\omega B} & \frac{1}{2}\vert \omega \vert^2 \
Subject \quad to & Y_i (\omega x_i + b) \ge 1,i=1,2,\ldots,n
\end{align*}
$$

Walk one of the support vector machines (SVM)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.