glearn.kernels.Kernel#

class glearn.kernels.Kernel#

Base class of kernel functions.

Warning

This class is a base class and does not implement a kernel function. Use the derivative of this class instead.

Examples

Create Kernel Object:

>>> from glearn import kernels

>>> # Create an exponential kernel
>>> kernel = kernels.Exponential()

>>> # Evaluate kernel at the point x=0.5
>>> x = 0.5
>>> kernel(x)
0.6065306597126334

>>> # Evaluate first derivative of kernel at the point x=0.5
>>> kernel(x, derivarive=1)
-0.6065306597126334

>>> # Evaluate second derivative of kernel at the point x=0.5
>>> kernel(x, derivarive=2)
0.6065306597126334

>>> # Plot kernel and its first and second derivative
>>> kernel.plot()
../_images/kernel_exponential.png

Methods

__call__

Evaluate the kernel function or its derivatives.

plot(self[, compare_numerical, x_max, filename])

Plot the kernel function and its first and second derivative.