AlignerDtwDtai
Aligner interface for dtaidistance time warping alignment.
Quickstart
from sktime.alignment.dtaidist import AlignerDtwDtai
estimator = AlignerDtwDtai(use_c=False, window=None, max_dist=None, max_step=None, max_length_diff=None, penalty=None, psi=None, inner_dist='squared euclidean')Parameters(8)
- use_c: bool, optional, default=False
Whether to use the faster C variant:
Truefor C,Falsefor Python.Truerequires a C compiled installation ofdtaidistance.If False, uses
dtaidistance.dtw_ndim.distance_matrix.If True, uses
dtaidistance.dtw_ndim.distance_matrix_fast.
- windowinteger, optional, default=infinite
Sakoe Chiba window width, from diagonal to boundary. Only allow for maximal shifts from the two diagonals smaller than this number. The maximally allowed warping, thus difference between indices i in series 1 and j in series 2, is thus |i-j| < 2*window + |len(s1) - len(s2)|. It includes the diagonal, meaning that Euclidean distance is obtained by setting
window=1.If the two series are of equal length, this means that the band appearing on the cumulative cost matrix is of width 2*window-1. In other definitions of DTW this number may be referred to as the window instead.- max_dist: float, optional, default=infinite
- Stop if the returned values will be larger than this value.
- max_step: float, optional, default=infinite
Do not allow steps larger than this value. If the difference between two values in the two series is larger than this, thus if |s1[i]-s2[j]| > max_step, replace that value with infinity.
- max_length_diff: int, optional, default=infinite
- Return infinity if difference of length of two series is larger than this value.
- penalty: float, optional, default=0
- Penalty to add if compression or expansion is applied
- psi: integer or 4-tuple of integers or none, optional, default=none
- Psi relaxation parameter (ignore start and end of matching). If psi is a single integer, it is used for both start and end relaxations for both series in a pair of series. If psi is a 4-tuple, it is used as the psi-relaxation for (begin series1, end series1, begin series2, end series2). Useful for cyclical series.
- inner_dist: str, or sktime BasePairwiseTransformer, default=”squared euclidean”
Distance between two points in the time series.
If str, must be one of ‘squared euclidean’ (default), ‘euclidean’.
if estimator, must follow sktime BasePairwiseTransformer API. For a range of distances from scipy, see
ScipyDist.
References
- [1 ] H. Sakoe, S. Chiba, “Dynamic programming algorithm optimization for spoken word recognition,” IEEE Transactions on Acoustics, Speech and Signal Processing, vol. 26(1), pp. 43–49, 1978.