Back to models
Transformer (Pairwise Panel)

IndepDist

Variable-wise aggregate of multivariate kernel or distance function.

A common baseline method to turn a univariate time series distance or kernel into a multivariate time series distance or kernel.

Also sometimes known as “independent distance” in the special case where aggfun is the sum or mean and the pairwise transformer is a time series distance.

Formal details (for real valued objects, mixed typed rows in analogy): Let \(d: \mathbb{R}^n \times \mathbb{R}^n\rightarrow \mathbb{R}\) be the pairwise function in dist, when applied to univariate series of length \(n\). This class represents the pairwise function \(d_g: \mathbb{R}^{n\times D} \times \mathbb{R}^{n\times D}\rightarrow \mathbb{R}\) defined as \(d_g(x, y):= g(d(x_1, y_1), \dots, d(x_D, y_D))\), where \(x_i\), \(y_i\) denote the \(i\)-th column, and \(x\), :math:``y` are interpreted as multivariate time series with :math:`D` variables, and where :math:`g` is a function :math:`g: \mathbb{R}^D\times \mathbb{R}^D \rightarrow \mathbb{R}`, representing the input ``aggfun.

In particular, if aggfun="sum" (or default), then \(g(x) = \sum_{i=1}^D x_i\), and \(d_g(x, y):= \sum_{i=1}^D d(x_i, y_i)\), which corresponds to the usual terminology “independent distance”.

Quickstart

python
from sktime.dists_kernels.indep import IndepDist

estimator = IndepDist(dist, aggfun=None)

Parameters(2)

distpairwise transformer of BasePairwiseTransformer scitype, or
callable np.ndarray (n_samples, nd) x (n_samples, nd) -> (n_samples x n_samples)
aggfunoptional, str or callable np.ndarray (m, nd, nd) -> (nd, nd)

aggregation function over the variables, \(g\) above “sum” = np.sum = default “mean” = np.mean “median” = np.median “max” = np.max “min” = np.min when starting with a function (m) -> scalar, use np.apply_along_axis to create a function (m, nd, nd) -> (nd, nd) and pass that as aggfun

Examples

>>> from sktime.dists_kernels.indep import IndepDist
>>> from sktime.dists_kernels.dtw import DtwDist
>>> 
>>> dist = IndepDist (DtwDist ())