How to check if a kernel is a valid kernel

If I define my own method for determining the similarity between the two input objects of my vector support machine classifier, and thus define it as my kernel, how can I check if it is really a valid kernel that I can use?

For example, if my inputs are strings, and the kernel that I select allows me to say some metric for the distance of the string, how can I decide if I can use it or not for my SVM. I know that there are some conditions for a valid SVM kernel. Can someone tell me what they are and how this is done to verify these conditions?

+7
source share
3 answers

The kernel functions must satisfy the Mercer condition. You can also find answers to what you ask for statistics .

+6
source

The simplest test is based on the following: a kernel function is valid if and only if the kernel matrix for any particular set of data points has all non-negative eigenvalues. You can easily verify this by taking a sufficiently large set of data points and simply checking to see if this is true. For example, if you accidentally select 2000 data samples, create your own 2000x2000 kernel matrix, and notice that it has non-negative eigenvalues, then it is very likely that you have a legitimate kernel. Alternatively, if there are any negative eigenvalues, then the candidate-box-function is definitely not a legitimate core.

+6
source

Also a link you can check is http://cs.nyu.edu/~dsontag/courses/ml12/slides/lecture6.pdf , where the author provides "Nuclear Algebra", which follows from the above statements - Mercer, that the corresponding the core matrix is ​​symmetric positive semidefinite and a positive eigenvalue follows from it. As an example, the author also shows that the Gauss function makes a real kernel. I will give it here if you do not want to find the link: Kernel Algebra and Description of the Proof of Gaussian as a Real Kernel

+2
source

All Articles