radial.kernel {svmpath} | R Documentation |
compute the kernel matrix for svmpath
radial.kernel(x, y=x, param.kernel = 1/p,...) poly.kernel(x, y=x, param.kernel = 1,...)
x |
an n x p matrix of features |
y |
an m x p matrix of features (if omitted, it defaults to |
param.kernel |
the parameter(s) for the kernel. For this radial kernel, the parameter is known in the fields as "gamma". For the polynomial kernel, it is the "degree" |
... |
unused |
For the radial kernel, this computes the function exp(-g||x-y||^2) for each pair of rows x,y
from the input matrices. Here g is param.kernel.
For the polynomial kernel, it computes (xy'+1)^d, where d is param.kernel
.
An n x m matrix.
Trevor Hastie
The paper http://www-stat.stanford.edu/~hastie/Papers/svmpath.pdf, as well as the talk http://www-stat.stanford.edu/~hastie/TALKS/svmpathtalk.pdf.
svmpath
data(svmpath) attach(balanced.overlap) fit<-svmpath(x,y,kernel=radial.kernel) detach(2)