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

1 Ansicht (letzte 30 Tage)
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!

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 24 Apr. 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');

Weitere Antworten (0)

Tags

Noch keine Tags eingegeben.

Produkte


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by