I am working on SVMs and try to get all the concepts involved. For instance, the kernel mapping. I would like to construct some parts of the algorithm by myself, to understand what is happening.
My goal is to create a mapping as in this picture (taken from here)
I do not fully understand what the input and output values of the kernel are; to map the data points to the 3rd dimension, the output should be the Z-values, right? And the input are (vectors of) the X and Y-values?
My (matlab) code to get the z-values is:
z = exp(-( (abs(x-y).^2)./ (2*gamma^2) ));
But the z-values are just a bell-curve, us such:
I don't really know what I am doing wrong, but I think I confuse the concepts of kernel and (implicit/explicit) mapping.
How can I construct a (matlab) function that maps the 2D data to 3D space, using the Gaussian Radial Basis Function?
-- Edit -- Thanks to user27840 I made it work, with the following matlab code:
gamma = 2; D = squareform( pdist(data, 'euclidean') ); D = exp(-(D .^ 2) ./ ( 2*gamma^2)); z = sum(D);
This results in the following 3D plot, from original 2D data:
-- Edit2: -- For those who are interested in one-class support vector machines; I wrote a blog post about it, using the answer from this thread: Introduction to one-class Support Vector Machine