mvtsa.warping.PLADistance#

class mvtsa.warping.PLADistance(n_segments=10, kind='mdpla', weights=(0.5, 0.5), warping=True, window=None, znormalize=True)[source]#

Bases: _SegmentedCollection

Dissimilarities of piecewise linear approximations: MPLA, SPLA and the mixed MDPLA measure (Bankó and Abonyi, 2015).

Every series is approximated by n_segments linear segments (bottom-up PLA). The mean of a segment is scaled to [-1, 1] by the largest absolute segment mean of the collection, and its trend is the angle of its slope, \(\arctan(s)\) scaled by \(2/\pi\);

  • kind="mpla": \(d=\lvert\bar x_i-\bar y_j\rvert\);

  • kind="spla": \(d=\lvert\arctan s_i-\arctan s_j\rvert\) (eq. 5.2);

  • kind="mdpla": \(d=w_M d_{MPLA}+w_S d_{SPLA}\) (eq. 5.3).

Parameters:
n_segmentsint
kind{“mpla”, “spla”, “mdpla”}
weights(w_M, w_S)
warpingbool

DTW over segments (True) or index-wise comparison.

windowDTW window over segment indices.
znormalizebool

z-normalize every series first (as in the UCR experiments).

Examples using mvtsa.warping.PLADistance#

Piecewise linear warping: MPLA, SPLA and MDPLA

Piecewise linear warping: MPLA, SPLA and MDPLA