pyts.metrics.dtw(x=None, y=None, dist='square', method='region', options={'region': None}, precomputed_cost=None, return_cost=False, return_accumulated=False, return_path=False)

Dynamic Time Warping (DTW) distance with a constraint region.

This version of DTW allows users to provide their own constraint region. If not provided, no constraint region is used, which is exactly the classic DTW.

See also

For documentation for the rest of the parameters, see dtw().

region : None or array-like, shape = (2, n_timestamps_1) (default = None)

Constraint region. If None, no constraint region is used. Otherwise, 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.