Giter Site home page Giter Site logo

shabbirhasan1 / rustdtw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fl33tw00d/rustdtw

0.0 0.0 0.0 316 KB

Python extension backed by a multi-threaded Rust implementation of Dynamic Time Warping (DTW).

License: MIT License

Shell 0.73% Python 25.27% Rust 74.00%

rustdtw's Introduction

RustDTW

Python extension backed by a multi-threaded Rust implementation of Dynamic Time Warping (DTW).


⚡️ Quick Install

To install rustDTW, simply:

pip install rust-dtw

❓ What is Dynamic Time Warping

In time series analysis, dynamic time warping (DTW) is one of the algorithms for measuring similarity between two temporal sequences, which may vary in speed 1. This has applications in speech recognition, time series classification and neuroscience.

Example Usage

rustDTW was designed for usage with timeseries data from functional brain regions. However any data represented as a numpy matrix can be provided.

import numpy as np
import rust_dtw
  
rust_dtw.dtw(
  s=np.array([0., 1., 2.]), 
  t=np.array([3., 4., 5.]), 
  window=50, 
  distance_mode="euclidean"
  )
>>> 5.0990195

For more examples please see examples/ or explore the wiki.

Developing

Built With

  • PyO3
  • Maturin
  • rust-numpy
  • Rayon

Setting up Dev

To get started with development, simply clone the repository and edit the main library code in src/. Once done, simply build and test the code with ./build.sh.

git clone https://github.com/FL33TW00D/rustDTW.git
cd rust-dtw/
./build.sh

Tests

All tests are implemented using pytest.

poetry run pytest

📈 Performance


The above shows the performance of the rustdtw implementation vs the DTAIDistance OpenMP Python version, showing a ~10x speed improvement.

⚠️ License

rustDTW is free and open-source software licensed under the MIT License.

rustdtw's People

Contributors

fl33tw00d avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.