Transformer
Merger
Aggregates Panel data containing overlapping windows of one time series.
The input data contains multiple overlapping time series elements that could arranged as follows: xxxx…...xxxx…...xxxx… …xxxx.. ….xxxx. …..xxxx ……xxxx …….xxxx ……..xxxx ………xxxx The merger aggregates the data by aligning the time series windows as shown above and applying a aggregation function to the overlapping data points. The aggregation function can be one of “mean” or “median”. I.e., the mean or median of each column is calculated, resulting in a univariate time series.
Quickstart
python
from sktime.transformations.merger import Merger
estimator = Merger(method='median', stride=0)Parameters(2)
- method{ median, mean }, default=”median”
- The method to use for aggregation. Can be one of “mean” or “median”.
- strideint, default=0
- The stride to use for the aggregation. The stride determines the number of shifts between consecutive instances. A stride of 0 means no shift. A stride of 1 means that the time series is aggregated as above.
Examples
>>> from sktime.transformations.merger import Merger
>>> from sktime.utils._testing.panel import _make_panel
>>> y = _make_panel (n_instances = 10, n_columns = 3, n_timepoints = 5)
>>> result = Merger (method = "median"). fit_transform (y)
>>> result. shape (5, 3)
>>> from sktime.transformations.merger import Merger
>>> from sktime.utils._testing.panel import _make_panel
>>> y = _make_panel (n_instances = 10, n_columns = 3, n_timepoints = 5)
>>> result = Merger (method = "median", stride = 1). fit_transform (y)
>>> result. shape (14, 3)