Back to models
Transformer (Pairwise Panel)

KernelFromDist

Kernel function obtained from a distance function.

Formal details (for real valued objects, mixed typed rows in analogy): Let \(d: \mathbb{R}^D \times \mathbb{R}^D\rightarrow \mathbb{R}\) be the pairwise function in dist, when applied to D-vectors. If dist_diag=None, then KernelFromDist(dist) corresponds to the kernel function \(k(x, y):= d(x, x)^2 + d(y, y)^2 - 0.5 \cdot d(x, y)^2\). If dist_diag is provided, and corresponds to a function \(f:\mathbb{R}^D \rightarrow \mathbb{R}\), then KernelFromDist(dist) corresponds to the kernel function \(k(x, y):= f(x, x)^2 + f(y, y)^2 - 0.5 \cdot d(x, y)^2\).

It should be noted that \(k\) is, in general, not positive semi-definite.

Quickstart

python
from sktime.dists_kernels.dist_to_kern import KernelFromDist

estimator = KernelFromDist(dist, dist_diag=None)

Parameters(2)

distpairwise transformer of BasePairwiseTransformer scitype, or
callable np.ndarray (n_samples, nd) x (n_samples, nd) -> (n_samples x n_samples)
dist_diagpairwise transformer of BasePairwiseTransformer scitype, or
series-to-panel transformer of Basetransformer scitype, or callable np.ndarray (n_samples, nd) -> (n_samples,)