surrogate.kernels.Kernel

surrogate.kernels.Kernel()

Base class for Kernels.

Methods

Name Description
diag Returns the diagonal of the kernel k(X, X).

diag

surrogate.kernels.Kernel.diag(X)

Returns the diagonal of the kernel k(X, X).

The result of this method is equivalent to np.diag(self(X)); however, it can be evaluated more efficiently.

Parameters

Name Type Description Default
X np.ndarray Argument of the kernel evaluation. required

Returns

Name Type Description
np.ndarray np.ndarray: Diagonal of the kernel matrix, shape (n_samples_X,).