| kernel.functions | R Documentation |
Compute similarities between feature vectors according to a specific kernel function
cauchy.kernel(W, sigma = 1) laplacian.kernel(W, sigma = 1) gaussian.kernel(W, sigma = 1) inv.multiquadric.kernel(W, v = 1) identity.kernel(W, a = 1) linear.kernel(W, a = 1) poly.kernel(W, degree = 2, scale = -1, v = 0)
W |
a numeric matrix, Rows are examples and columns are features |
sigma |
a real value representing the sigma parameter (def. 1) of the Cauchy, Gaussian and Laplacian kernel |
v |
constant factor (def. 1) of the inverse multiquadric kernel and of the polynomail kernel; for the inverse multiquadric kernel v must be larger than 0. |
a |
unused parameter, maintained for compatibility reasons . |
degree |
integer corresponding to a degree of the polynomial (def. 2) |
scale |
double: scaling factor of the polynomial kernel. If scale=-1 (def) scale is set to 1/ncol(W); |
All the kernel matrices are computed by calling C code to speed-up the computation.
cauchy.kernel computes the Cauchy kernel.
laplacian.kernel computes the Lapalacian kernel.
gaussian.kernel computes the Gaussian kernel.
inv.multiquadric.kernel computes the inverse multiquadric kernel.
identity.kernel computes the identity kernel. In this case the input W represents a similarity square matrix (obtained i.e. through the Pearson correlation) between examples.
linear.kernel computes the linear kernel.
A kernel matrix representing the similarities between the examples (rows of W), according to a specific kernel function.
rw.kernel-methods
# computing kernels on the Tanimoto chemical structure similarity matrix library(bionetdata); data(DD.chem.data); K <- identity.kernel(DD.chem.data); K <- linear.kernel(DD.chem.data); K <- gaussian.kernel(DD.chem.data); K <- inv.multiquadric.kernel(DD.chem.data); K <- poly.kernel(DD.chem.data);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.