pyts.metrics.sakoe_chiba_band¶
-
pyts.metrics.sakoe_chiba_band(n_timestamps, window_size=0.1)[source]¶ Compute the Sakoe-Chiba band.
Parameters: - n_timestamps : int
The size of both time series.
- window_size : int or float (default = 0.1)
The window above and below the diagonale. If float, it must be between 0 and 1, and the actual window size will be computed as
ceil(window_size * (n_timestamps - 1)). Each cell whose distance with the diagonale is lower than or equal to ‘window_size’ becomes a valid cell for the path.
Returns: - region : array, shape = (2, n_timestamps)
Constraint region. The first row consists of the starting indices (included) and the second row consists of the ending indices (excluded) of the valid rows for each column.
Examples
>>> from pyts.metrics import sakoe_chiba_band >>> print(sakoe_chiba_band(5, window_size=2)) [[0 0 0 1 2] [3 4 5 5 5]]