klus.kernels module

class klus.kernels.gaussianKernel(sigma)[source]

Bases: object

Gaussian kernel with bandwidth sigma.

diff(x, y)[source]
ddiff(x, y)[source]
laplace(x, y)[source]
class klus.kernels.gaussianKernelGeneralized(sigma)[source]

Bases: object

Generalized Gaussian kernel with bandwidths sigma = (sigma_1, ..., sigma_d).

diff(x, y)[source]
ddiff(x, y)[source]
laplace(x, y)[source]
class klus.kernels.laplacianKernel(sigma)[source]

Bases: object

Laplacian kernel with bandwidth sigma.

diff(x, y)[source]
ddiff(x, y)[source]
laplace(x, y)[source]
class klus.kernels.polynomialKernel(p, c=1)[source]

Bases: object

Polynomial kernel with degree p and inhomogeneity c.

diff(x, y)[source]
ddiff(x, y)[source]
laplace(x, y)[source]
class klus.kernels.periodicKernel1D(p, sigma)[source]

Bases: object

One-dimensional periodic kernel with frequency p and bandwidth sigma.

diff(x, y)[source]
ddiff(x, y)[source]
class klus.kernels.stringKernel(kn=2, l=0.9)[source]

Bases: object

String kernel implementation based on Marianna Madry's C++ code, see https://github.com/mmadry/string_kernel.

evaluate(x, y)[source]

Unnormalized string kernel evaluation.

class klus.kernels.productKernel(k)[source]

Bases: object

Product of one-dimensional kernels, i.e., k(x) = k(x_1) ... k(x_d).

diff(x, y)[source]
ddiff(x, y)[source]
laplace(x, y)[source]
klus.kernels.gramian(X, k)[source]

Compute Gram matrix for training data X with kernel k.

klus.kernels.gramian2(X, Y, k)[source]

Compute Gram matrix for training data X and Y with kernel k.

class klus.kernels.densityEstimate(X, k, beta=1)[source]

Bases: object

Kernel density estimation using the Gaussian kernel.

rho(x)[source]
V(x)[source]
gradV(x)[source]