Description Usage Arguments Details Value Author(s) See Also
These functions transform a n x q matrix into a n x n kernel matrix.
1 | kernel.matrix(Z, whichkernel, rho = NULL, gamma = NULL, d = NULL)
|
Z |
a n x q matrix |
whichkernel |
kernel function |
gamma, rho, d |
kernel hyperparameters (see details) |
Given a n x p matrix, this function returns a n x n matrix where each cell represents the similarity between two samples defined by two p-dimensional vectors x and y,
the Gaussian kernel is defined as k(x,y) = exp(-||x-y||^2 / rho) where ||x-y|| is the Euclidean distance between x and y and rho > 0 is the bandwidth of the kernel,
the linear kernel is defined as k(x,y) = t(x).y,
the polynomial kernel is defined as k(x,y) = (rho.t(x).y + gamma)^d with rho > 0, d is the polynomial order. Of note, a linear kernel is a polynomial kernel with rho = d = 1 and gamma = 0,
the sigmoid kernel is defined as k(x,y) = tanh(rho.t(x).y + gamma) which is similar to the sigmoid function in logistic regression,
the inverse quadratic function defined as k(x,y) = 1 / sqrt( ||x-y||^2 + gamma) with gamma > 0,
the equality kernel defined as k(x,y) = 1 if x = y, 0 otherwise.
A n x n matrix.
Catherine Schramm, Aurelie Labbe, Celia Greenwood
kernel.gaussian, kernel.linear, kernel.polynomial, kernel.equality, kernel.sigmoid, kernel.inverse.quadratic.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.