pyts.utils
.segmentation¶
-
pyts.utils.
segmentation
(ts_size, window_size, overlapping=False, n_segments=None)[source]¶ Compute the indices for Piecewise Agrgegate Approximation.
Parameters: - ts_size : int
The size of the time series.
- window_size : int
The size of the window.
- overlapping : bool (default = False)
If True, overlapping windows may be used. If False, non-overlapping are used.
- n_segments : int or None (default = None)
The number of windows. If None, the number is automatically computed using
window_size
.
Returns: - start : array
The lower bound for each window.
- end : array
The upper bound for each window.
- size : int
The size of
start
.
Examples
>>> from pyts.utils import segmentation >>> start, end, size = segmentation(ts_size=12, window_size=3) >>> print(start) [0 3 6 9] >>> print(end) [ 3 6 9 12] >>> size 4