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