Aligner
AlignerEditNumba
DistanceDistance-matrix
Interface to sktime native edit distance aligners.
Quickstart
python
from sktime.alignment.edit_numba import AlignerEditNumba
estimator = AlignerEditNumba(distance: str='lcss', window=None, itakura_max_slope=None, bounding_matrix: ndarray=None, epsilon: float=1.0, g: float=0.0, lmbda: float=1.0, nu: float=0.001, p: int=2)Parameters(9)
- distance: str, one of [“lcss”, “edr”, “erp”, “twe”], optional, default = “lcss”
- name of the distance that is calculated
- window: float, default = None
- Float that is the radius of the sakoe chiba window (if using Sakoe-Chiba lower bounding). Value must be between 0. and 1.
- itakura_max_slope: float, default = None
- Gradient of the slope for itakura parallelogram (if using Itakura Parallelogram lower bounding)
- bounding_matrix: 2D np.ndarray, optional, default = None
if passed, must be of shape (len(X), len(X2)) for X, X2 in
transformCustom bounding matrix to use. If defined then other lower_bounding params are ignored. The matrix should be structure so that indexes considered in bound should be the value 0. and indexes outside the bounding matrix should be infinity.- epsilonfloat, defaults = 1.
- Used in LCSS, EDR, ERP, otherwise ignored Matching threshold to determine if two subsequences are considered close enough to be considered ‘common’.
- g: float, defaults = 0.
- Used in ERP, otherwise ignored. The reference value to penalise gaps.
- lmbda: float, optional, default = 1.0
- Used in TWE, otherwise ignored. A constant penalty that punishes the editing efforts. Must be >= 1.0.
- nu: float optional, default = 0.001
- Used in TWE, otherwise ignored. A non-negative constant which characterizes the stiffness of the elastic twe measure. Must be > 0.
- p: int optional, default = 2
- Used in TWE, otherwise ignored. Order of the p-norm for local cost.
Examples
>>> from sktime.datasets import load_unit_test
>>> from sktime.dists_kernels.edit_dist import EditDist
>>>
>>> X, _ = load_unit_test (return_type = "pd-multiindex")
>>> d = EditDist ("edr")
>>> distmat = d. transform (X) distances are also callable, this does the same:
>>> distmat = d(X) # doctest: +SKIPReferences
- [1 ] M. Vlachos, D. Gunopoulos, and G. Kollios. 2002. “Discovering Similar Multidimensional Trajectories”, In Proceedings of the 18th International Conference on Data Engineering (ICDE ‘02). IEEE Computer Society, USA, 673. [2 ] Lei Chen, M. Tamer Özsu, and Vincent Oria. 2005. Robust and fast similarity search for moving object trajectories. In Proceedings of the 2005 ACM SIGMOD international conference on Management of data (SIGMOD ‘05). Association for Computing Machinery, New York, NY, USA, 491-502. DOI:https://doi.org/10.1145/1066157.1066213 [3 ] Lei Chen and Raymond Ng. 2004. On the marriage of Lp-norms and edit distance. In Proceedings of the Thirtieth international conference on Very large data bases - Volume 30 (VLDB ‘04). VLDB Endowment, 792-803. [4 ] Marteau, P.; F. (2009). “Time Warp Edit Distance with Stiffness Adjustment for Time Series Matching”. IEEE Transactions on Pattern Analysis and Machine Intelligence. 31 (2): 306-318.