dtaidistance | Time series distances : Dynamic Time Warping | Time Series Database library

 by   wannesm Python Version: 2.3.12 License: Non-SPDX

kandi X-RAY | dtaidistance Summary

kandi X-RAY | dtaidistance Summary

dtaidistance is a Python library typically used in Database, Time Series Database applications. dtaidistance has no bugs, it has no vulnerabilities, it has build file available and it has medium support. However dtaidistance has a Non-SPDX License. You can install using 'pip install dtaidistance' or download it from GitHub, PyPI.

Time series distances: Dynamic Time Warping (fast DTW implementation in C)
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              dtaidistance has a medium active ecosystem.
              It has 898 star(s) with 172 fork(s). There are 24 watchers for this library.
              There were 1 major release(s) in the last 6 months.
              There are 12 open issues and 142 have been closed. On average issues are closed in 112 days. There are 5 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of dtaidistance is 2.3.12

            kandi-Quality Quality

              dtaidistance has 0 bugs and 0 code smells.

            kandi-Security Security

              dtaidistance has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              dtaidistance code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              dtaidistance has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              dtaidistance releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              dtaidistance saves you 1913 person hours of effort in developing the same functionality from scratch.
              It has 6277 lines of code, 366 functions and 39 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed dtaidistance and discovered the below as its top functions. This is intended to give you an instant insight into dtaidistance implemented functionality, and help decide if they suit your requirements.
            • Plot the structure
            • Get the min and max values of the series
            • Return the linkage of a node
            • Print the build extensions
            • Check for OpenMP availability
            • Check if clang is in clang
            • R Plot two paths
            • Find the best path in a list
            • Estimate the tree
            • Computes the entropy of the targets
            • Performs clustering
            • Plot the series
            • Evaluate needleman - Wunsch
            • Make a substitution function
            • Calculate the distance between two paths
            • Return a dict of all the available targets
            • Compute the linkage tree
            • Fast distance matrix
            • Warp between two vectors
            • Compute weights for the given series
            • Calculate the distance from a series t
            • Generate a template
            • Return a dictionary of the available targets
            • Calculate the path probability based on warping_path
            • Test if the test fails
            • Fast path to warping path
            • Return the start and end segment of the alignment
            Get all kandi verified functions for this library.

            dtaidistance Key Features

            No Key Features are available at this moment for dtaidistance.

            dtaidistance Examples and Code Snippets

            No Code Snippets are available at this moment for dtaidistance.

            Community Discussions

            QUESTION

            How to make knn faster?
            Asked 2022-Jan-02 at 17:11

            I have a dataset of shape(700000,20) and I want to apply KNN to it.

            However on testing it takes really huge time,can someone expert please help to let me know how can I reduce the KNN predicting time.

            Is there something like GPU-KNN or something.Please help to let me know.

            Below is the code I am using.

            ...

            ANSWER

            Answered 2022-Jan-01 at 22:19

            I can suggest reducing the number of features which i think its 20 features from your dataset shape, Which mean you have 20 dimensions.

            You can reduce the number of features by using PCA (Principal Component Analysis) like the following:

            Source https://stackoverflow.com/questions/70533500

            QUESTION

            speedup dtaidistance key function with numba
            Asked 2021-Aug-17 at 13:51

            The DTAIDistance package can be used to find k best matches of the input query. but it cannot be used for multi-dimensional input query. moreover, I want to find the k best matches of many input queries in one run.

            I modified the DTAIDistance function so that it can be used to search subsequences of multi-dimensions of multi-queries. I use njit with parallel to speed up the process,i.e.the p_calc function which applies numba-parallel to each of the input query. but I find that the parallel calculation seems not to speed up the calculation compared to just simply looping over the input queries one by one, i.e. the calc function.

            ...

            ANSWER

            Answered 2021-Aug-16 at 21:00

            I assume the code of both implementations are correct and as been carefully checked (otherwise the benchmark would be pointless).

            The issue likely comes from the compilation time of the function. Indeed, the first call is significantly slower than next calls, even with cache=True. This is especially important for the parallel implementation as compiling parallel Numba code is often slower (since it is more complex). The best solution to avoid this is to compile Numba functions ahead of time by providing types to Numba.

            Besides this, benchmarking a computation only once is usually considered as a bad practice. Good benchmarks perform multiple iterations and remove the first ones (or consider them separately). Indeed, several other problems can appear when a code is executed for the first time: CPU caches (and the TLB) are cold, the CPU frequency can change during the execution and is likely smaller when the program is just started, page faults may need to be needed, etc.

            In practice, I cannot reproduce the issue. Actually, p_calc is 3.3 times faster on my 6-core machine. When the benchmark is done in a loop of 5 iterations, the measured time of the parallel implementation is much smaller: about 13 times (which is actually suspicious for a parallel implementation using 6 threads on a 6-core machine).

            Source https://stackoverflow.com/questions/68799536

            QUESTION

            What is the correct way to format the parameters for DTW in Similarity Measures?
            Asked 2021-Jun-01 at 17:44

            I am trying to use the DTW algorithm from the Similarity Measures library. However, I get hit with an error that states a 2-Dimensional Array is required. I am not sure I understand how to properly format the data, and the documentation is leaving me scratching my head.

            https://github.com/cjekel/similarity_measures/blob/master/docs/similaritymeasures.html

            According to the documentation the function takes two arguments (exp_data and num_data ) for the data set, which makes sense. What doesn't make sense to me is:

            exp_data : array_like

            Curve from your experimental data. exp_data is of (M, N) shape, where M is the number of data points, and N is the number of dimensions

            This is the same for both the exp_data and num_data arguments.

            So, for further clarification, let's say I am implementing the fastdtw library. It looks like this:

            ...

            ANSWER

            Answered 2021-Jun-01 at 17:44

            It appears the solution in my case was to include the index in the array. For example, if your data looks like this:

            Source https://stackoverflow.com/questions/67744927

            QUESTION

            Imitate Visual C++ with MinGW or other C++ compilers (for Python packages based on Visual C++)
            Asked 2020-Aug-11 at 11:19

            Is there a way to use MinGW as a substitute of MS Visual C++? A lot of Python packages need VS C++ to be installed: 4.5 GB of disk space! MinGW takes only 450 MB and reaches the same aim to compile C/C++.

            I am using Visual Studio Code, and I try to avoid the Microsoft Visual C++ installation that is proposed here under 3) --> You can also install just the C++ Build Tools: https://code.visualstudio.com/docs/cpp/config-msvc/#_prerequisites

            Perhaps there is just a trick needed to imitate MS Visual C++ with MinGW, so that the Python packages directly find the MinGW compiler as if it were MS Visual C++? Perhaps adding symlinks to the lib directory and adding some system variable path?

            My question is strongly linked with Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

            The error that I get when I install a package that needs MS Visual C++ as an example, installing pip install dtaidistance:

            ...

            ANSWER

            Answered 2020-Aug-11 at 11:19

            There is no answer.

            1. MSVC

            I have sent feedback to them, yet I did not get any reply. A Python developer assured that they know about this size issue anyway and do not like it either. The only chance is a change from MSVC developers themselves. It is unlikely, but not impossible, that the size will be reduced in future releases by the MSVC team.

            1. Python distutils workaround

            The Python community will not provide a distutils workaround, see https://discuss.python.org/t/imitate-visual-c-with-mingw-or-other-c-compilers-for-python-packages-based-on-visual-c/4609/11.

            Quote from the Python forum:

            There was a workaround until Python 3.4 which might also be an approach now: Use MinGW compiler till Python 3.4 by adding a “distutils.cfg” to the folder “\Lib\distutils” in Python install directory. It would be nice to have that MinGW “distutils.cfg” workaround for the recent Python versions as well.

            Now it turns out that distutils will not be a realistic workaround.

            • There is no one who will work on it. A Python developer who was involved in the project before: Maybe there is ...

            ... someone else who might offer to help. But I wouldn’t be too optimistic.

            • And a deprecation issue:

            As an aside, now that setuptools has fully taken on distutils, we’ll be deprecating it in the standard library (soon). So this request in future would have to be made to each project implementing a build tool.

            Source https://stackoverflow.com/questions/62149329

            QUESTION

            How to get distance matrix using dynamic time wraping?
            Asked 2020-Jun-05 at 09:14

            I have 6 timeseries values as follows.

            ...

            ANSWER

            Answered 2020-Jun-05 at 09:14

            Everything is correct. As per the docs:

            The result is stored in a matrix representation. Since only the upper triangular matrix is required this representation uses more memory then necessary.

            All diagonal elements are 0 the the lower triangular matrix is the the same as the upper triagular matrix mirrored at the diagonal. As all these value can be deducted from the upper triangular matrix they aren't shown in the output.
            You can even use the compact=True argument to only get the values from the upper diagonal matrix concatenated into a 1D array.

            You can convert the result to a full matrix like this:

            Source https://stackoverflow.com/questions/62211066

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install dtaidistance

            In case the C based version is not available, see the documentation for alternative installation options. In case OpenMP is not available on your system add the --noopenmp global option.

            Support

            https://people.cs.kuleuven.be/wannes.meert
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install dtaidistance

          • CLONE
          • HTTPS

            https://github.com/wannesm/dtaidistance.git

          • CLI

            gh repo clone wannesm/dtaidistance

          • sshUrl

            git@github.com:wannesm/dtaidistance.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link