Zurück zu den Modellen
Transformer (Pairwise Panel)

AggrDist

Panel distance from tabular distance aggregation.

panel distance obtained by applying aggregation function to tabular distance matrix

example: AggrDist(ScipyDist()) is mean Euclidean distance between series

Formal details (for real valued objects, mixed typed rows in analogy): Let \(d: \mathbb{R}^k \times \mathbb{R}^{k}\rightarrow \mathbb{R}\) be the pairwise function in transformer, when applied to k-vectors. Let \(f:\mathbb{R}^{n \ times m}\) be the function aggfunc when applied to an \((n \times m)\) matrix. Let \(x_1, \dots, x_N\in \mathbb{R}^{n \times k}\), \(y_1, \dots y_M \in \mathbb{R}^{m \times k}\) be collections of matrices, representing time series panel valued inputs X and X2, as follows: \(x_i\) is the i-th instance in X, and \(x_{i, j\ell}\) is the j-th time point, \ell-th variable of X. Analogous for \(y\) and X2.

Then, transform(X, X2) returns the \((N \times M)\) matrix with \((i, j)\)-th entry \(f \left((d(x_{i, a}, y_{j, b}))_{a, b}\right)\), where \(x_{i, a}\) denotes the \(a\)-th row of \(x_i\), and \(y_{j, b}\) denotes the \(b\)-th row of \(x_j\).

Schnellstart

python
from sktime.dists_kernels.compose_tab_to_panel import AggrDist

estimator = AggrDist(transformer, aggfunc=None, aggfunc_is_symm=False)

Parameter(3)

transformer: pairwise transformer of BasePairwiseTransformer scitype
aggfunc: aggregation function (2D np.array) -> float or None, optional
default = None = np.mean
aggfunc_is_symm: bool, optional, default=False
whether aggregation function is symmetric (should be set according to aggfunc)
i.e., invariant under transposing argument, it always holds that

aggfunc(matrix) = aggfunc(np.transpose(matrix))

Beispiele

Mean pairwise euclidean distance between between time series
>>> from sktime.dists_kernels import AggrDist, ScipyDist
>>> mean_euc_tsdist = AggrDist (ScipyDist ()) Mean pairwise Gaussian kernel between time series
>>> from sklearn.gaussian_process.kernels import RBF
>>> mean_gaussian_tskernel = AggrDist (RBF ())