The Statistics Toolbox R2014a offers the following kernels with the "svmtrain" function:
- Linear
- Quadratic
- Polynomial
- Gaussian Radial Basis Function
- Multilayer Perceptron
Hybrid kernels are not readily available. However, there is an option to provide a custom kernel function using a function handle.
To train an SVM using a hybrid kernel, you would have to write the code for the hybrid kernel function. The kernel function must be of the form:
where the returned value, "K", is a matrix of size M-by-N, and "U" and "V" have "M" and "N" rows respectively.
You could use the custom kernel "kfun" by specifying the "kernel_function" argument as follows:
load fisheriris
xdata = meas(51:end,3:4);
group = species(51:end);
svmStruct = svmtrain(xdata,group,'ShowPlot',true,'kernel_function',@kfun);
Here is an example of a hyperbolic tangent kernel that could be used with "svmtrain":
function K = kfun(U,V)
K = tanh(U*V');
Best Answer