仓库指标
- Star
- (7,162 star)
- PR 合并指标
- (平均合并 26天 10小时) (30 天内合并 86 个 PR)
描述
It would be great to have a simple, no-bells-and-whistles signature feature transformer implemented in sktime.
(Most variations like windowing or augmentations can then be obtained from this via transformation pipelines)
Current implementations suffer either from overengineering (and/or unclear, unstable interfaces), or dependency on abandoned packages relying on lower python versions, see discussion in https://github.com/sktime/sktime/issues/7255
However, the idea behind signatures is quite simple, they are time-ordered generalizations of moments for multivariate time series, I describe it in the following for a bivariate time series (after taking first differences).
Let $(x_{1,1}, x_{2,1}) , \dots, (x_{1,T}, x_{2,T})$ be a bivariate time series.
Elements of the "signature" are indexed by strings made up of the literals 1, and 2. I list the signature elements for the strings up to length 3, the general pattern should follow.
1: the mean of the ${x_{1, i}}$, over all $i$.
2: the mean of the ${x_{2, i}}$, over all $i$.
11: the mean of all products ${x_{1, i}\cdot x_{1, j}}$, over all $i<j$.
12: the mean of all products ${x_{1, i}\cdot x_{2, j}}$, over all $i<j$.
$\ell m$ : the mean of all products ${x_{\ell, i}\cdot x_{m, j}}$, over all $i<j$.
$\ell m n$: the mean of all products ${x_{\ell, i}\cdot x_{m, j}\cdot x_{n, k}}$, over all $i<j<k$.
And so on. Generalisation to longer strings, or more dimensions should be clear.
Due to combinatorial explosion, it typically does not make sense to compute higher than 3, or 2 for high-dimensional time series.
The transformer should be parameterized in terms of an integer degree, that is the length of strings to include. Often, the index of the time series is included as a dimension, so for univariate time series, one gets two dimension together with the time index. This should be a boolean option, e.g., use_index.
For column names of the output, I would simply choose the strings as above, e.g., "1", "2", "12", and so on.
The transformer is "series-to-primitives" type, the supersimple extension template should be sufficient to follow: https://github.com/sktime/sktime/blob/main/extension_templates/transformer_supersimple.py
The scitypes:transform-output tag should change to `"Primitives".