Git Product home page Git Product logo

mkalgo's Introduction

mkalgo (MK Algorithm)

This package provides Pythonic (>=2.6) implementation of Mueen-Keogh (MK) algorithm for finding motifs in the time series.

Citation

Mueen, A., Keogh, E., Zhu, Q., Cash, S. and Westover, B. Exact Discovery of Time Series Motif. SDM 2009 (link).

Explanation

This algorithm aims to find significant pairs of motifs (identical subsequences in a time-series which repeat more than once) in a given time-series. The usual bruteforce methods of finding these motifis are usually O(n^2) in terms of their complexity, while MK Algorithm aims to find them in O(n * log(n)) order.

Usage

This implementation contains both MK-Early Abandoning and standard MK algorithm implementations:

>>> from mkalgo.mk import mk_eab, mk
MK-EAB
>>> obj = mk_eab(l=5, metric='euclidean')
>>> motif_a, motif_b = obj.search(timeseries)
MK
>>> obj = mk_eab(l=5, metric='euclidean', r=10)
>>> motif_a, motif_b = obj.search(timeseries)
  • l refers to the desired length of motif pairs to be found
  • metric refers to the distance metric to be utilized, which can be euclidean or dtw (dynamic time warping).

The returned object is a dictionary, containing the respective motif and its beginning and ending indices in the given timeseries.

Both the implementations can be used in the similar fashion, with mk taking an additional parameter of r, which refers to the number of rounds made over n/l chunks of the time-series to find the significant reference point.

mkalgo's People

Contributors

saifuddin778 avatar

Stargazers

 avatar

Watchers

 avatar  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.