Does the Statistics Toolbox support hybrid kernels to train Support Vector Machines in MATLAB?

1 visualización (últimos 30 días)
I see that the Statistics Toolbox R2014a provides a function called "svmtrain" to train an SVM. What kernels can I use to train it on my data? Can I use a hybrid kernel, i.e. a kernel made by mixing, for example, a linear kernel and a polynomial kernel?
Thanks!

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 24 de Abr. de 2014
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:
 
function K = kfun(U,V)
 
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');

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by