Giter Club home page Giter Club logo

awarp's Introduction

Awarp

Python implementation of AWarp algorithm using numba to optimize machine code at runtime.

Usage

Given 2 run length encoded time series:

s = np.array([1, 2, 3, -1, 1])

t = np.array([1, -2, 4, 1])

To calculate global AWarp distance:

awarp.awarp(s, t)

To calculate costrained AWarp distance:

awarp.awarp(s, t, w=4)

where w is the size of the window in number of points.

License

MIT

awarp's People

Contributors

mclmza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kilianb

awarp's Issues

Constrained version suffers from integer overflow

Please see pull request: #2

awarp sometimes returns np.nan for calculations since values in the distance matrix [-1,-1] are negative and the square root fails. This is related to an uncaught overflow in numpy or numba

Run-length encoding example

Thanks for the implementation. I'd be interested to use it in a project on sparse binary sequences. However, I'm not yet sure about your expected format. You provide these two arrays here as examples:

s = np.array([1, 2, 3, -1, 1])
t = np.array([1, -2, 4, 1])

However, I don't get how these match either the run-length encoding of the paper (then I'd expect numbers highlighted somehow to give an idea of the number of zeros) nor the encoding described as in Wikipedia, as then I'd expect both to be of even length, as it would be alternating between the count and the value (i.e., decoded t would be t = np.array([-2, 1,1,1,1]), but s would not be clear due to uneven length).

Can you provide an example of the original time series and the encoded ones?

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.