dtaidistance


Namedtaidistance JSON
Version 2.3.11 PyPI version JSON
download
home_pagehttps://github.com/wannesm/dtaidistance
SummaryDistance measures for time series (Dynamic Time Warping, fast C implementation)
upload_time2023-11-08 09:46:03
maintainer
docs_urlNone
authorWannes Meert
requires_python>=3.5
licenseApache 2.0
keywords dtw time series dynamic time warping distance
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPi Version](https://img.shields.io/pypi/v/dtaidistance.svg)](https://pypi.org/project/dtaidistance/)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/dtaidistance.svg)](https://anaconda.org/conda-forge/dtaidistance)
[![Documentation Status](https://readthedocs.org/projects/dtaidistance/badge/?version=latest)](https://dtaidistance.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/80764246.svg)](https://zenodo.org/badge/latestdoi/80764246) 

# Time Series Distances

Library for time series distances (e.g. Dynamic Time Warping) used in the
[DTAI Research Group](https://dtai.cs.kuleuven.be). The library offers a pure
Python implementation and a fast implementation in C. The C implementation
has only Cython as a dependency. It is compatible with Numpy and Pandas and
implemented such that unnecessary data copy operations are avoided.

Documentation: http://dtaidistance.readthedocs.io

Example:

    from dtaidistance import dtw
    import numpy as np
    s1 = np.array([0.0, 0, 1, 2, 1, 0, 1, 0, 0])
    s2 = np.array([0.0, 1, 2, 0, 0, 0, 0, 0, 0])
    d = dtw.distance_fast(s1, s2)

Citing this work:

> Wannes Meert, Kilian Hendrickx, Toon Van Craenendonck, Pieter Robberechts, Hendrik Blockeel & Jesse Davis.  
> DTAIDistance (Version v2). Zenodo.  
> http://doi.org/10.5281/zenodo.5901139

**New in v2**:

- Numpy is now an optional dependency, also to compile the C library
  (only Cython is required).
- Small optimizations throughout the C code to improve speed.
- The consistent use of `ssize_t` instead of `int` allows for larger data structures on 64 bit 
  machines and be more compatible with Numpy.
- The parallelization is now implemented directly in C (included if OpenMP is installed).
- The `max_dist` argument turned out to be similar to Silva and Batista's work 
  on PrunedDTW [7]. The toolbox now implements a version that is equal to PrunedDTW
  since it prunes more partial distances. Additionally, a `use_pruning` argument
  is added to automatically set `max_dist` to the Euclidean distance, as suggested
  by Silva and Batista, to speed up the computation (a new method `ub_euclidean` is available).
- Support in the C library for multi-dimensional sequences in the `dtaidistance.dtw_ndim`
  package.
- DTW Barycenter Averaging for clustering (v2.2).
- Subsequence search and local concurrences (v2.3).
- Support for N-dimensional time series (v2.3.7).


## Installation

    $ pip install dtaidistance
    
or

    $ conda install -c conda-forge dtaidistance

The pip installation requires Numpy as a dependency to compile Numpy-compatible
C code (using Cython). However, this dependency is optional and can be removed.

The source code is available at
[github.com/wannesm/dtaidistance](https://github.com/wannesm/dtaidistance).

If you encounter any problems during compilation (e.g. the C-based implementation or OpenMP
is not available), see the 
[documentation](https://dtaidistance.readthedocs.io/en/latest/usage/installation.html)
for more options.

## Usage

### Dynamic Time Warping (DTW) Distance Measure

    from dtaidistance import dtw
    from dtaidistance import dtw_visualisation as dtwvis
    import numpy as np
    s1 = np.array([0., 0, 1, 2, 1, 0, 1, 0, 0, 2, 1, 0, 0])
    s2 = np.array([0., 1, 2, 3, 1, 0, 0, 0, 2, 1, 0, 0, 0])
    path = dtw.warping_path(s1, s2)
    dtwvis.plot_warping(s1, s2, path, filename="warp.png")

![Dynamic Time Warping (DTW) Example](https://people.cs.kuleuven.be/wannes.meert/dtw/dtw_example.png?v=5)


#### DTW Distance Measure Between Two Series

Only the distance measure based on two sequences of numbers:

    from dtaidistance import dtw
    s1 = [0, 0, 1, 2, 1, 0, 1, 0, 0]
    s2 = [0, 1, 2, 0, 0, 0, 0, 0, 0]
    distance = dtw.distance(s1, s2)
    print(distance)

The fastest version (30-300 times) uses c directly but requires an array as input (with the double type),
and (optionally) also prunes computations by setting `max_dist` to the Euclidean upper bound:

    from dtaidistance import dtw
    import array
    s1 = array.array('d',[0, 0, 1, 2, 1, 0, 1, 0, 0])
    s2 = array.array('d',[0, 1, 2, 0, 0, 0, 0, 0, 0])
    d = dtw.distance_fast(s1, s2, use_pruning=True)

Or you can use a numpy array (with dtype double or float):

    from dtaidistance import dtw
    import numpy as np
    s1 = np.array([0, 0, 1, 2, 1, 0, 1, 0, 0], dtype=np.double)
    s2 = np.array([0.0, 1, 2, 0, 0, 0, 0, 0, 0])
    d = dtw.distance_fast(s1, s2, use_pruning=True)


Check the `__doc__` for information about the available arguments:

    print(dtw.distance.__doc__)

A number of options are foreseen to early stop some paths the dynamic programming algorithm is exploring or tune
the distance measure computation:

- `window`: Only allow for shifts up to this amount away from the two diagonals.
- `max_dist`: Stop if the returned distance measure will be larger than this value.
- `max_step`: Do not allow steps larger than this value.
- `max_length_diff`: Return infinity if difference in length of two series is larger.
- `penalty`: Penalty to add if compression or expansion is applied (on top of the distance).
- `psi`: Psi relaxation to ignore begin and/or end of sequences (for cylical sequences) [2].
- `use_pruning`: Prune computations based on the Euclidean upper bound.


#### DTW Distance Measure all warping paths

If, next to the distance, you also want the full matrix to see all possible warping paths:

    from dtaidistance import dtw
    s1 = [0, 0, 1, 2, 1, 0, 1, 0, 0]
    s2 = [0, 1, 2, 0, 0, 0, 0, 0, 0]
    distance, paths = dtw.warping_paths(s1, s2)
    print(distance)
    print(paths)

The matrix with all warping paths can be visualised as follows:

    from dtaidistance import dtw
    from dtaidistance import dtw_visualisation as dtwvis
    import random
    import numpy as np
    x = np.arange(0, 20, .5)
    s1 = np.sin(x)
    s2 = np.sin(x - 1)
    random.seed(1)
    for idx in range(len(s2)):
        if random.random() < 0.05:
            s2[idx] += (random.random() - 0.5) / 2
    d, paths = dtw.warping_paths(s1, s2, window=25, psi=2)
    best_path = dtw.best_path(paths)
    dtwvis.plot_warpingpaths(s1, s2, paths, best_path)

![DTW Example](https://people.cs.kuleuven.be/wannes.meert/dtw/warping_paths.png?v=3)

Notice the `psi` parameter that relaxes the matching at the beginning and end.
In this example this results in a perfect match even though the sine waves are slightly shifted.


#### DTW Distance Measures Between Set of Series

To compute the DTW distance measures between all sequences in a list of sequences, use the method `dtw.distance_matrix`.
You can set variables to use more or less c code (`use_c` and `use_nogil`) and parallel or serial execution
(`parallel`).

The `distance_matrix` method expects a list of lists/arrays:

    from dtaidistance import dtw
    import numpy as np
    series = [
        np.array([0, 0, 1, 2, 1, 0, 1, 0, 0], dtype=np.double),
        np.array([0.0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0]),
        np.array([0.0, 0, 1, 2, 1, 0, 0, 0])]
    ds = dtw.distance_matrix_fast(series)

or a matrix (in case all series have the same length):

    from dtaidistance import dtw
    import numpy as np
    series = np.matrix([
        [0.0, 0, 1, 2, 1, 0, 1, 0, 0],
        [0.0, 1, 2, 0, 0, 0, 0, 0, 0],
        [0.0, 0, 1, 2, 1, 0, 0, 0, 0]])
    ds = dtw.distance_matrix_fast(series)


#### DTW Distance Measures Between Set of Series, limited to block

You can instruct the computation to only fill part of the distance measures matrix.
For example to distribute the computations over multiple nodes, or to only 
compare source series to target series.

    from dtaidistance import dtw
    import numpy as np
    series = np.matrix([
         [0., 0, 1, 2, 1, 0, 1, 0, 0],
         [0., 1, 2, 0, 0, 0, 0, 0, 0],
         [1., 2, 0, 0, 0, 0, 0, 1, 1],
         [0., 0, 1, 2, 1, 0, 1, 0, 0],
         [0., 1, 2, 0, 0, 0, 0, 0, 0],
         [1., 2, 0, 0, 0, 0, 0, 1, 1]])
    ds = dtw.distance_matrix_fast(series, block=((1, 4), (3, 5)))

The output in this case will be:

    #  0     1    2    3       4       5
    [[ inf   inf  inf     inf     inf  inf]    # 0
     [ inf   inf  inf  1.4142  0.0000  inf]    # 1
     [ inf   inf  inf  2.2360  1.7320  inf]    # 2
     [ inf   inf  inf     inf  1.4142  inf]    # 3
     [ inf   inf  inf     inf     inf  inf]    # 4
     [ inf   inf  inf     inf     inf  inf]]   # 5


## Clustering

A distance matrix can be used for time series clustering. You can use existing methods such as
`scipy.cluster.hierarchy.linkage` or one of two included clustering methods (the latter is a
wrapper for the SciPy linkage method).

    from dtaidistance import clustering
    # Custom Hierarchical clustering
    model1 = clustering.Hierarchical(dtw.distance_matrix_fast, {})
    cluster_idx = model1.fit(series)
    # Augment Hierarchical object to keep track of the full tree
    model2 = clustering.HierarchicalTree(model1)
    cluster_idx = model2.fit(series)
    # SciPy linkage clustering
    model3 = clustering.LinkageTree(dtw.distance_matrix_fast, {})
    cluster_idx = model3.fit(series)


For models that keep track of the full clustering tree (`HierarchicalTree` or `LinkageTree`), the
tree can be visualised:

    model.plot("myplot.png")

![Dynamic Time Warping (DTW) hierarchical clusteringt](https://people.cs.kuleuven.be/wannes.meert/dtw/hierarchy.png?v=2)


## Dependencies

- [Python 3](http://www.python.org)

Optional:

- [Cython](http://cython.org)
- [Numpy](http://www.numpy.org)
- [tqdm](https://github.com/tqdm/tqdm)
- [Matplotlib](https://matplotlib.org)
- [SciPy](https://www.scipy.org)
- [PyClustering](https://pyclustering.github.io)

Development:

- [pytest](http://doc.pytest.org)
- [pytest-benchmark](http://pytest-benchmark.readthedocs.io)


## Contact

- https://people.cs.kuleuven.be/wannes.meert


## References

1. T. K. Vintsyuk,
   Speech discrimination by dynamic programming.
   Kibernetika, 4:81–88, 1968.
2. 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.
3. C. S. Myers and L. R. Rabiner,
   A comparative study of several dynamic time-warping algorithms for connected-word recognition.
   The Bell System Technical Journal, 60(7):1389–1409, Sept 1981.
4. Mueen, A and Keogh, E, 
   [Extracting Optimal Performance from Dynamic Time Warping](http://www.cs.unm.edu/~mueen/DTW.pdf),
   Tutorial, KDD 2016
5. D. F. Silva, G. E. A. P. A. Batista, and E. Keogh.
   [On the effect of endpoints on dynamic time warping](http://www-bcf.usc.edu/~liu32/milets16/paper/MiLeTS_2016_paper_7.pdf),
   In SIGKDD Workshop on Mining and Learning from Time Series, II. Association for Computing Machinery-ACM, 2016.
6. C. Yanping, K. Eamonn, H. Bing, B. Nurjahan, B. Anthony, M. Abdullah and B. Gustavo.
   [The UCR Time Series Classification Archive](www.cs.ucr.edu/~eamonn/time_series_data/), 2015.
7. D. F. Silva and G. E. Batista. 
   [Speeding up all-pairwise dynamic time warping matrix calculation](http://sites.labic.icmc.usp.br/dfs/pdf/SDM_PrunedDTW.pdf),
   In Proceedings of the 2016 SIAM International Conference on Data Mining, pages 837–845. SIAM, 2016.



## License

    DTAI distance code.

    Copyright 2016-2022 KU Leuven, DTAI Research Group

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wannesm/dtaidistance",
    "name": "dtaidistance",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "dtw,time series,dynamic time warping,distance",
    "author": "Wannes Meert",
    "author_email": "wannes.meert@cs.kuleuven.be",
    "download_url": "https://files.pythonhosted.org/packages/2b/c1/311c764d9ee62bfa0faf8979108267f9922cd0d270ab496820643477e9df/dtaidistance-2.3.11.tar.gz",
    "platform": null,
    "description": "[![PyPi Version](https://img.shields.io/pypi/v/dtaidistance.svg)](https://pypi.org/project/dtaidistance/)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/dtaidistance.svg)](https://anaconda.org/conda-forge/dtaidistance)\n[![Documentation Status](https://readthedocs.org/projects/dtaidistance/badge/?version=latest)](https://dtaidistance.readthedocs.io/en/latest/?badge=latest)\n[![DOI](https://zenodo.org/badge/80764246.svg)](https://zenodo.org/badge/latestdoi/80764246) \n\n# Time Series Distances\n\nLibrary for time series distances (e.g. Dynamic Time Warping) used in the\n[DTAI Research Group](https://dtai.cs.kuleuven.be). The library offers a pure\nPython implementation and a fast implementation in C. The C implementation\nhas only Cython as a dependency. It is compatible with Numpy and Pandas and\nimplemented such that unnecessary data copy operations are avoided.\n\nDocumentation: http://dtaidistance.readthedocs.io\n\nExample:\n\n    from dtaidistance import dtw\n    import numpy as np\n    s1 = np.array([0.0, 0, 1, 2, 1, 0, 1, 0, 0])\n    s2 = np.array([0.0, 1, 2, 0, 0, 0, 0, 0, 0])\n    d = dtw.distance_fast(s1, s2)\n\nCiting this work:\n\n> Wannes Meert, Kilian Hendrickx, Toon Van Craenendonck, Pieter Robberechts, Hendrik Blockeel & Jesse Davis.  \n> DTAIDistance (Version v2). Zenodo.  \n> http://doi.org/10.5281/zenodo.5901139\n\n**New in v2**:\n\n- Numpy is now an optional dependency, also to compile the C library\n  (only Cython is required).\n- Small optimizations throughout the C code to improve speed.\n- The consistent use of `ssize_t` instead of `int` allows for larger data structures on 64 bit \n  machines and be more compatible with Numpy.\n- The parallelization is now implemented directly in C (included if OpenMP is installed).\n- The `max_dist` argument turned out to be similar to Silva and Batista's work \n  on PrunedDTW [7]. The toolbox now implements a version that is equal to PrunedDTW\n  since it prunes more partial distances. Additionally, a `use_pruning` argument\n  is added to automatically set `max_dist` to the Euclidean distance, as suggested\n  by Silva and Batista, to speed up the computation (a new method `ub_euclidean` is available).\n- Support in the C library for multi-dimensional sequences in the `dtaidistance.dtw_ndim`\n  package.\n- DTW Barycenter Averaging for clustering (v2.2).\n- Subsequence search and local concurrences (v2.3).\n- Support for N-dimensional time series (v2.3.7).\n\n\n## Installation\n\n    $ pip install dtaidistance\n    \nor\n\n    $ conda install -c conda-forge dtaidistance\n\nThe pip installation requires Numpy as a dependency to compile Numpy-compatible\nC code (using Cython). However, this dependency is optional and can be removed.\n\nThe source code is available at\n[github.com/wannesm/dtaidistance](https://github.com/wannesm/dtaidistance).\n\nIf you encounter any problems during compilation (e.g. the C-based implementation or OpenMP\nis not available), see the \n[documentation](https://dtaidistance.readthedocs.io/en/latest/usage/installation.html)\nfor more options.\n\n## Usage\n\n### Dynamic Time Warping (DTW) Distance Measure\n\n    from dtaidistance import dtw\n    from dtaidistance import dtw_visualisation as dtwvis\n    import numpy as np\n    s1 = np.array([0., 0, 1, 2, 1, 0, 1, 0, 0, 2, 1, 0, 0])\n    s2 = np.array([0., 1, 2, 3, 1, 0, 0, 0, 2, 1, 0, 0, 0])\n    path = dtw.warping_path(s1, s2)\n    dtwvis.plot_warping(s1, s2, path, filename=\"warp.png\")\n\n![Dynamic Time Warping (DTW) Example](https://people.cs.kuleuven.be/wannes.meert/dtw/dtw_example.png?v=5)\n\n\n#### DTW Distance Measure Between Two Series\n\nOnly the distance measure based on two sequences of numbers:\n\n    from dtaidistance import dtw\n    s1 = [0, 0, 1, 2, 1, 0, 1, 0, 0]\n    s2 = [0, 1, 2, 0, 0, 0, 0, 0, 0]\n    distance = dtw.distance(s1, s2)\n    print(distance)\n\nThe fastest version (30-300 times) uses c directly but requires an array as input (with the double type),\nand (optionally) also prunes computations by setting `max_dist` to the Euclidean upper bound:\n\n    from dtaidistance import dtw\n    import array\n    s1 = array.array('d',[0, 0, 1, 2, 1, 0, 1, 0, 0])\n    s2 = array.array('d',[0, 1, 2, 0, 0, 0, 0, 0, 0])\n    d = dtw.distance_fast(s1, s2, use_pruning=True)\n\nOr you can use a numpy array (with dtype double or float):\n\n    from dtaidistance import dtw\n    import numpy as np\n    s1 = np.array([0, 0, 1, 2, 1, 0, 1, 0, 0], dtype=np.double)\n    s2 = np.array([0.0, 1, 2, 0, 0, 0, 0, 0, 0])\n    d = dtw.distance_fast(s1, s2, use_pruning=True)\n\n\nCheck the `__doc__` for information about the available arguments:\n\n    print(dtw.distance.__doc__)\n\nA number of options are foreseen to early stop some paths the dynamic programming algorithm is exploring or tune\nthe distance measure computation:\n\n- `window`: Only allow for shifts up to this amount away from the two diagonals.\n- `max_dist`: Stop if the returned distance measure will be larger than this value.\n- `max_step`: Do not allow steps larger than this value.\n- `max_length_diff`: Return infinity if difference in length of two series is larger.\n- `penalty`: Penalty to add if compression or expansion is applied (on top of the distance).\n- `psi`: Psi relaxation to ignore begin and/or end of sequences (for cylical sequences) [2].\n- `use_pruning`: Prune computations based on the Euclidean upper bound.\n\n\n#### DTW Distance Measure all warping paths\n\nIf, next to the distance, you also want the full matrix to see all possible warping paths:\n\n    from dtaidistance import dtw\n    s1 = [0, 0, 1, 2, 1, 0, 1, 0, 0]\n    s2 = [0, 1, 2, 0, 0, 0, 0, 0, 0]\n    distance, paths = dtw.warping_paths(s1, s2)\n    print(distance)\n    print(paths)\n\nThe matrix with all warping paths can be visualised as follows:\n\n    from dtaidistance import dtw\n    from dtaidistance import dtw_visualisation as dtwvis\n    import random\n    import numpy as np\n    x = np.arange(0, 20, .5)\n    s1 = np.sin(x)\n    s2 = np.sin(x - 1)\n    random.seed(1)\n    for idx in range(len(s2)):\n        if random.random() < 0.05:\n            s2[idx] += (random.random() - 0.5) / 2\n    d, paths = dtw.warping_paths(s1, s2, window=25, psi=2)\n    best_path = dtw.best_path(paths)\n    dtwvis.plot_warpingpaths(s1, s2, paths, best_path)\n\n![DTW Example](https://people.cs.kuleuven.be/wannes.meert/dtw/warping_paths.png?v=3)\n\nNotice the `psi` parameter that relaxes the matching at the beginning and end.\nIn this example this results in a perfect match even though the sine waves are slightly shifted.\n\n\n#### DTW Distance Measures Between Set of Series\n\nTo compute the DTW distance measures between all sequences in a list of sequences, use the method `dtw.distance_matrix`.\nYou can set variables to use more or less c code (`use_c` and `use_nogil`) and parallel or serial execution\n(`parallel`).\n\nThe `distance_matrix` method expects a list of lists/arrays:\n\n    from dtaidistance import dtw\n    import numpy as np\n    series = [\n        np.array([0, 0, 1, 2, 1, 0, 1, 0, 0], dtype=np.double),\n        np.array([0.0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0]),\n        np.array([0.0, 0, 1, 2, 1, 0, 0, 0])]\n    ds = dtw.distance_matrix_fast(series)\n\nor a matrix (in case all series have the same length):\n\n    from dtaidistance import dtw\n    import numpy as np\n    series = np.matrix([\n        [0.0, 0, 1, 2, 1, 0, 1, 0, 0],\n        [0.0, 1, 2, 0, 0, 0, 0, 0, 0],\n        [0.0, 0, 1, 2, 1, 0, 0, 0, 0]])\n    ds = dtw.distance_matrix_fast(series)\n\n\n#### DTW Distance Measures Between Set of Series, limited to block\n\nYou can instruct the computation to only fill part of the distance measures matrix.\nFor example to distribute the computations over multiple nodes, or to only \ncompare source series to target series.\n\n    from dtaidistance import dtw\n    import numpy as np\n    series = np.matrix([\n         [0., 0, 1, 2, 1, 0, 1, 0, 0],\n         [0., 1, 2, 0, 0, 0, 0, 0, 0],\n         [1., 2, 0, 0, 0, 0, 0, 1, 1],\n         [0., 0, 1, 2, 1, 0, 1, 0, 0],\n         [0., 1, 2, 0, 0, 0, 0, 0, 0],\n         [1., 2, 0, 0, 0, 0, 0, 1, 1]])\n    ds = dtw.distance_matrix_fast(series, block=((1, 4), (3, 5)))\n\nThe output in this case will be:\n\n    #  0     1    2    3       4       5\n    [[ inf   inf  inf     inf     inf  inf]    # 0\n     [ inf   inf  inf  1.4142  0.0000  inf]    # 1\n     [ inf   inf  inf  2.2360  1.7320  inf]    # 2\n     [ inf   inf  inf     inf  1.4142  inf]    # 3\n     [ inf   inf  inf     inf     inf  inf]    # 4\n     [ inf   inf  inf     inf     inf  inf]]   # 5\n\n\n## Clustering\n\nA distance matrix can be used for time series clustering. You can use existing methods such as\n`scipy.cluster.hierarchy.linkage` or one of two included clustering methods (the latter is a\nwrapper for the SciPy linkage method).\n\n    from dtaidistance import clustering\n    # Custom Hierarchical clustering\n    model1 = clustering.Hierarchical(dtw.distance_matrix_fast, {})\n    cluster_idx = model1.fit(series)\n    # Augment Hierarchical object to keep track of the full tree\n    model2 = clustering.HierarchicalTree(model1)\n    cluster_idx = model2.fit(series)\n    # SciPy linkage clustering\n    model3 = clustering.LinkageTree(dtw.distance_matrix_fast, {})\n    cluster_idx = model3.fit(series)\n\n\nFor models that keep track of the full clustering tree (`HierarchicalTree` or `LinkageTree`), the\ntree can be visualised:\n\n    model.plot(\"myplot.png\")\n\n![Dynamic Time Warping (DTW) hierarchical clusteringt](https://people.cs.kuleuven.be/wannes.meert/dtw/hierarchy.png?v=2)\n\n\n## Dependencies\n\n- [Python 3](http://www.python.org)\n\nOptional:\n\n- [Cython](http://cython.org)\n- [Numpy](http://www.numpy.org)\n- [tqdm](https://github.com/tqdm/tqdm)\n- [Matplotlib](https://matplotlib.org)\n- [SciPy](https://www.scipy.org)\n- [PyClustering](https://pyclustering.github.io)\n\nDevelopment:\n\n- [pytest](http://doc.pytest.org)\n- [pytest-benchmark](http://pytest-benchmark.readthedocs.io)\n\n\n## Contact\n\n- https://people.cs.kuleuven.be/wannes.meert\n\n\n## References\n\n1. T. K. Vintsyuk,\n   Speech discrimination by dynamic programming.\n   Kibernetika, 4:81\u201388, 1968.\n2. H. Sakoe and S. Chiba,\n   Dynamic programming algorithm optimization for spoken word recognition.\n   IEEE Transactions on Acoustics, Speech and Signal Processing, 26(1):43\u201349, 1978.\n3. C. S. Myers and L. R. Rabiner,\n   A comparative study of several dynamic time-warping algorithms for connected-word recognition.\n   The Bell System Technical Journal, 60(7):1389\u20131409, Sept 1981.\n4. Mueen, A and Keogh, E, \n   [Extracting Optimal Performance from Dynamic Time Warping](http://www.cs.unm.edu/~mueen/DTW.pdf),\n   Tutorial, KDD 2016\n5. D. F. Silva, G. E. A. P. A. Batista, and E. Keogh.\n   [On the effect of endpoints on dynamic time warping](http://www-bcf.usc.edu/~liu32/milets16/paper/MiLeTS_2016_paper_7.pdf),\n   In SIGKDD Workshop on Mining and Learning from Time Series, II. Association for Computing Machinery-ACM, 2016.\n6. C. Yanping, K. Eamonn, H. Bing, B. Nurjahan, B. Anthony, M. Abdullah and B. Gustavo.\n   [The UCR Time Series Classification Archive](www.cs.ucr.edu/~eamonn/time_series_data/), 2015.\n7. D. F. Silva and G. E. Batista. \n   [Speeding up all-pairwise dynamic time warping matrix calculation](http://sites.labic.icmc.usp.br/dfs/pdf/SDM_PrunedDTW.pdf),\n   In Proceedings of the 2016 SIAM International Conference on Data Mining, pages 837\u2013845. SIAM, 2016.\n\n\n\n## License\n\n    DTAI distance code.\n\n    Copyright 2016-2022 KU Leuven, DTAI Research Group\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "Distance measures for time series (Dynamic Time Warping, fast C implementation)",
    "version": "2.3.11",
    "project_urls": {
        "DTAIDistance documentation": "http://dtaidistance.readthedocs.io/en/latest/",
        "DTAIDistance source": "https://github.com/wannesm/dtaidistance",
        "Homepage": "https://github.com/wannesm/dtaidistance"
    },
    "split_keywords": [
        "dtw",
        "time series",
        "dynamic time warping",
        "distance"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2825ccb00399c28f6298ec7b9ac075a231197496665484c2b721d59e9924d7cd",
                "md5": "7d9166852410e77da133f8aeced6c1f6",
                "sha256": "ae49e46a84b8ab5563b13871cdb6fa78fe05991ab11a15dde36939f5463a4ca0"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp310-cp310-macosx_11_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "7d9166852410e77da133f8aeced6c1f6",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.5",
            "size": 1181879,
            "upload_time": "2023-11-08T10:01:21",
            "upload_time_iso_8601": "2023-11-08T10:01:21.614508Z",
            "url": "https://files.pythonhosted.org/packages/28/25/ccb00399c28f6298ec7b9ac075a231197496665484c2b721d59e9924d7cd/dtaidistance-2.3.11-cp310-cp310-macosx_11_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1edd6ee2a37cdc4a4c15e1a4d69281ed71ae4ce662c6644d4a3e98c9e98e9d69",
                "md5": "7ec4db443a1b847a0bf2ea6a597a939c",
                "sha256": "f489bcf5776303b52207807eb173bff11b8b5e7a355830c6fd80be36f007fd8b"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "7ec4db443a1b847a0bf2ea6a597a939c",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.5",
            "size": 2884215,
            "upload_time": "2023-11-08T10:01:24",
            "upload_time_iso_8601": "2023-11-08T10:01:24.392318Z",
            "url": "https://files.pythonhosted.org/packages/1e/dd/6ee2a37cdc4a4c15e1a4d69281ed71ae4ce662c6644d4a3e98c9e98e9d69/dtaidistance-2.3.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a555e277c222c785d25bcac548b4fba020a7e3b1ba4e57378e13b186eb44de62",
                "md5": "1040cdd6ab1f9735e230e6728f2c0065",
                "sha256": "32bf75498fec2e89de294309698ab6e4a420a21bb030628b04e5b124648c2a66"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "1040cdd6ab1f9735e230e6728f2c0065",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.5",
            "size": 1071893,
            "upload_time": "2023-11-08T10:01:26",
            "upload_time_iso_8601": "2023-11-08T10:01:26.692122Z",
            "url": "https://files.pythonhosted.org/packages/a5/55/e277c222c785d25bcac548b4fba020a7e3b1ba4e57378e13b186eb44de62/dtaidistance-2.3.11-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dbb970a8432879181c3565b9df3a84e5be6535ef60d233533d755076490e0a8a",
                "md5": "d3f89e1eddef422e386c48d6b959ea96",
                "sha256": "bbb15caee33f175c37346fa303cfb66ad1ae1bfcc6192840ba8b8b7f75c71937"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp311-cp311-macosx_14_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "d3f89e1eddef422e386c48d6b959ea96",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.5",
            "size": 1244782,
            "upload_time": "2023-11-08T09:45:48",
            "upload_time_iso_8601": "2023-11-08T09:45:48.338242Z",
            "url": "https://files.pythonhosted.org/packages/db/b9/70a8432879181c3565b9df3a84e5be6535ef60d233533d755076490e0a8a/dtaidistance-2.3.11-cp311-cp311-macosx_14_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a1973761bbc4c6fc39d625a3592990d7f7bd80e8b9504e50564d8149aed078dc",
                "md5": "10954d712ada4ffe6fc42ee8b32e5ac3",
                "sha256": "d84e738ab3ce12f912554dc5777232547443fbd1005d53a2309726f7525c9ead"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "10954d712ada4ffe6fc42ee8b32e5ac3",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.5",
            "size": 2774508,
            "upload_time": "2023-11-08T10:01:28",
            "upload_time_iso_8601": "2023-11-08T10:01:28.652960Z",
            "url": "https://files.pythonhosted.org/packages/a1/97/3761bbc4c6fc39d625a3592990d7f7bd80e8b9504e50564d8149aed078dc/dtaidistance-2.3.11-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8712814f1c792e8782481181da6035581c09bf732eb8cf2e18cf7dc950dca990",
                "md5": "b46f48cabe5deeb2da23cf524d15e4a4",
                "sha256": "06fa79fed8430e243859afa13c80b5c6e323d962cf4fd17c7c34da91edb79b71"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp38-cp38-macosx_11_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "b46f48cabe5deeb2da23cf524d15e4a4",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.5",
            "size": 1179387,
            "upload_time": "2023-11-08T10:01:30",
            "upload_time_iso_8601": "2023-11-08T10:01:30.877107Z",
            "url": "https://files.pythonhosted.org/packages/87/12/814f1c792e8782481181da6035581c09bf732eb8cf2e18cf7dc950dca990/dtaidistance-2.3.11-cp38-cp38-macosx_11_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c20084a1f1af04a5644b6362e782f8a53c9483d646c33bbd0ba7a6d7904ccacb",
                "md5": "672f5db249a11e6b00768c777af799b7",
                "sha256": "ed866da77b2377c5820350d767fd7d8097a84701d43c23e66b7e255bd6833c90"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "672f5db249a11e6b00768c777af799b7",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.5",
            "size": 2931632,
            "upload_time": "2023-11-08T10:01:33",
            "upload_time_iso_8601": "2023-11-08T10:01:33.308540Z",
            "url": "https://files.pythonhosted.org/packages/c2/00/84a1f1af04a5644b6362e782f8a53c9483d646c33bbd0ba7a6d7904ccacb/dtaidistance-2.3.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d53c9294975a16458fafaeffc0d3814b0c89f06747a18a45795556d0a20f5ac",
                "md5": "702de5a9541baa869c27d4b1be76f272",
                "sha256": "e1011080168078e80952c96003629ce8048dc5d451801a1d38012ee09ae90fd8"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "702de5a9541baa869c27d4b1be76f272",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.5",
            "size": 1080659,
            "upload_time": "2023-11-08T10:01:35",
            "upload_time_iso_8601": "2023-11-08T10:01:35.731768Z",
            "url": "https://files.pythonhosted.org/packages/9d/53/c9294975a16458fafaeffc0d3814b0c89f06747a18a45795556d0a20f5ac/dtaidistance-2.3.11-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2278254592eb1da7b4311766395491233721efc8c930edfd58d0416925b2d934",
                "md5": "bdab5fd697f1ff36a4e2746c88002fcb",
                "sha256": "6deec549e9aa14cc222d9eb73811b291ea4501183db6d1ee8476dc2a2234b989"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp39-cp39-macosx_11_0_x86_64.whl",
            "has_sig": false,
            "md5_digest": "bdab5fd697f1ff36a4e2746c88002fcb",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.5",
            "size": 1186438,
            "upload_time": "2023-11-08T10:01:38",
            "upload_time_iso_8601": "2023-11-08T10:01:38.093925Z",
            "url": "https://files.pythonhosted.org/packages/22/78/254592eb1da7b4311766395491233721efc8c930edfd58d0416925b2d934/dtaidistance-2.3.11-cp39-cp39-macosx_11_0_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4612329f63deaeb4001b889e58ca09f9dcadb0236d4e071c7f1b2cccf6ea965b",
                "md5": "7fa140827f3e027a3e3c2f08d6021a09",
                "sha256": "44f6934f7458b97411c958238806db853c246f6a0e8e056f0a412ae879921533"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "7fa140827f3e027a3e3c2f08d6021a09",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.5",
            "size": 2892806,
            "upload_time": "2023-11-08T10:01:40",
            "upload_time_iso_8601": "2023-11-08T10:01:40.527685Z",
            "url": "https://files.pythonhosted.org/packages/46/12/329f63deaeb4001b889e58ca09f9dcadb0236d4e071c7f1b2cccf6ea965b/dtaidistance-2.3.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c57f21ac5145e25b939049a07f62ec6c245363c1fab19d214026c2004b1d5234",
                "md5": "e03a34c783d4c641180064afa81bdefc",
                "sha256": "b7b056399c31aa2d27228fc995c2a3b52425e1c5f69a6fcb03a23556cdd0870f"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "e03a34c783d4c641180064afa81bdefc",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.5",
            "size": 1073642,
            "upload_time": "2023-11-08T10:01:42",
            "upload_time_iso_8601": "2023-11-08T10:01:42.709066Z",
            "url": "https://files.pythonhosted.org/packages/c5/7f/21ac5145e25b939049a07f62ec6c245363c1fab19d214026c2004b1d5234/dtaidistance-2.3.11-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2bc1311c764d9ee62bfa0faf8979108267f9922cd0d270ab496820643477e9df",
                "md5": "2e307831a39fca90fed4003430907d37",
                "sha256": "a3e471dd1ed5b22eff3f5dd4b285e6df1ba5a28be3322f51eef9e6571ea7090b"
            },
            "downloads": -1,
            "filename": "dtaidistance-2.3.11.tar.gz",
            "has_sig": false,
            "md5_digest": "2e307831a39fca90fed4003430907d37",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 8974958,
            "upload_time": "2023-11-08T09:46:03",
            "upload_time_iso_8601": "2023-11-08T09:46:03.950364Z",
            "url": "https://files.pythonhosted.org/packages/2b/c1/311c764d9ee62bfa0faf8979108267f9922cd0d270ab496820643477e9df/dtaidistance-2.3.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-08 09:46:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wannesm",
    "github_project": "dtaidistance",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "dtaidistance"
}
        
Elapsed time: 0.14112s