dtw(method=’sakoechiba’)¶
-
pyts.metrics.
dtw
(x=None, y=None, dist='square', method='sakoechiba', options={'window_size': 0.1}, precomputed_cost=None, return_cost=False, return_accumulated=False, return_path=False) Dynamic Time Warping (DTW) distance with Sakoe-Chiba band constraint.
The Sakoe-Chiba constraint region is a band centered around the main diagonal. Any cell whose distance to the diagonale is lower than a given value is valid for the path.
See also
For documentation for the rest of the parameters, see
dtw()
.Options: - window_size : float or int (default = 0.1)
The window size above and below the diagonal. If float, window_size must be between 0 and 1, and the actual window size will be computed as
ceil(window_size * max((n_timestamps_1, n_timestamps_2) - 1))
. If int, window_size must be the largest temporal shift allowed. Each cell whose distance with the diagonal is lower than or equal to window_size becomes a valid cell for the path.
References
[1] H. Sakoe and S. Chiba, “Dynamic programming algorithm optimization for spoken word recognition”. IEEE Transactions on Acoustics, Speech, and Signal Processing, 26(1), 43-49 (1978).