How can I define a kernel for my support vector machine using the BioInformatics Toolbox in MATLAB 7.8 (R2009a)?
2 views (last 30 days)
Show older comments
I am trying to define a kernel for my support vector machine, but I do not understand the documentation. For example, the kernel function must have inputs u and v, but I do not know what these inputs are.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
In the kernel function, u and v can be thought of as vectors from the vector space of the data. The kernel function defines an inner product on that vector space. When the kernel function is called during SVMTRAIN, the entire set of training data is passed as an MXN matrix. Here, M is the number of data points, and N is the length of a single data vector. The returned matrix is an MXM matrix for which the (i,jth) element of that matrix gives the inner product between the ith and jth training vector. So for example, to let the kernel be the L2-norm, one could use:
function y = kfun(u,v)
y = u*v';
0 Comments
More Answers (0)
See Also
Categories
Find more on Bioinformatics Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!