PiecewiseAggregateApproximation#
- class pyts.approximation.PiecewiseAggregateApproximation(window_size: int | float | None = 1, output_size: int | float | None = None, overlapping: bool = True)[source]#
Piecewise Aggregate Approximation.
- Parameters:
- window_sizeint, float or None (default = 1)
Length of the sliding window. If float, it represents a percentage of the size of each time series and must be between 0 and 1.
- output_sizeint, float or None (default = None)
Size of the returned time series. If float, it represents a percentage of the size of each time series and must be between 0. and 1. Ignored if
window_sizeis not None. It can’t be None ifwindow_sizeis None. If you want to useoutput_sizeoverwindow_size, you must setwindow_size=None.- overlappingbool (default = True)
When
window_size=None,output_sizeis used to derive the window size; the window size is fixed ifoverlapping=Trueand may vary ifoverlapping=False. Ignored ifwindow_sizeis specified.
References
[1]E. Keogh, K. Chakrabarti, M. Pazzani, and S. Mehrotra, “Dimensionality reduction for fast similarity search in large time series databases”. Knowledge and information Systems, 3(3), 263-286 (2001).
Examples
>>> from pyts.approximation import PiecewiseAggregateApproximation >>> X = [[0, 4, 2, 1, 7, 6, 3, 5], ... [2, 5, 4, 5, 3, 4, 2, 3]] >>> transformer = PiecewiseAggregateApproximation(window_size=2) >>> transformer.transform(X) array([[2. , 1.5, 6.5, 4. ], [3.5, 4.5, 3.5, 2.5]])
Methods
__init__([window_size, output_size, overlapping])fit([X, y])Pass.
fit_transform(X[, y])Fit to data, then transform it.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
set_params(**params)Set the parameters of this estimator.
transform(X)Reduce the dimensionality of each time series.
- __init__(window_size: int | float | None = 1, output_size: int | float | None = None, overlapping: bool = True) None[source]#