How SVM does the prediction

Source: Internet
Author: User

Reference: Understanding SVM three-tier realm

The original classification function:

By solving the duality problem, we get:

So the classification function is converted into:

prediction of linear kernel functions :

This concludes by using a linear kernel function (equivalent to not using a kernel function). For the new point x prediction, it is only necessary to calculate the inner product of the training data points, and all the non-support vectors corresponding to the coefficients are equal to 0, so for the new point of the inner product calculation is actually only for a small number of support vectors. "This shows that when the model is well trained, only the parameters and support vectors need to be preserved"

Ps: How to understand the support vector is a minority?

The objective function obtained by Lagrange multiplier method:

????

Note that if X is a support vector, the red portion of the upper formula is equal to 0 (because the functional margin of the support vector equals 1), and for non-support vectors, the functional margin is greater than 1, so the red color portion is greater than 0, and is non-negative, To satisfy the maximization, it must be equal to 0

?

Introducing kernel Functions :

Introduce the mapped classification function:

By solving the duality problem, we get:

So the classification function is converted into:

PS: The kernel function is actually an inner product expression with two vectors mapped. Only two vectors before the mapping (inner product, distance calculation, and so on) are required in the kernel function, and the result is equivalent to the inner product result of the high dimensional vector after mapping.

predictions with kernel functions :

???? For the prediction of the new point x, it is necessary to calculate the inner product (called kernel function) that is mapped to the training data point, and similarly, all non-support vectors correspond to coefficients equal to 0, so the calculation of the new point is actually only for a small number of support vectors.

???? Because of the particularity of the Gaussian kernel, the distance between the two vectors is calculated in the kernel function, so if the data is not normalized, the large value data will obscure the small value data.

?

How SVM does the prediction

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.