radial.kernel {svmpath} | R Documentation |
compute the kernel matrix for svmpath
Description
compute the kernel matrix for svmpath
Usage
radial.kernel(x, y=x, param.kernel = 1/p,...)
poly.kernel(x, y=x, param.kernel = 1,...)
Arguments
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 |
Details
For the radial kernel, this computes the function \exp(-\gamma||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^T+1)^d
, where d is param.kernel
.
Value
An n x m matrix.
Author(s)
Trevor Hastie
References
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.
See Also
svmpath
Examples
data(svmpath)
attach(balanced.overlap)
fit<-svmpath(x,y,kernel=radial.kernel)
detach(2)
[Package svmpath version 0.970 Index]