Giter VIP home page Giter VIP logo

python-sequence-kernels's Introduction

About

This is a really barbones toy project to illustrate how to compute a Gram matrix for the one-sided mean alignment kernel.

It reads a set of sequences from file example_data.txt, computes a Gram matrix of these sequences using the one-sided mean alignment kernel, computes the eigenvalues of this matrix and displays them. As the one-sided mean alignment kernel is provably positive definite, the eigenvalues are all positive.

The project also contains code to generate random dummy time series.

Usage

The project doesn't need any dependency so you can just execute it:

python mean_alignment.py

About the one-sided mean alignment kernel

Well-known kernel methods such as for example SVM and Kernel PCA rely on a kernel which is used computes a Gram matrix which can generally be interpreted as a matrix of similarity values between any pair of samples in the dataset. These algorithms require that the kernel be positive definite, which guarantees that the resulting optimization programs are convex whatever the samples.

When dealing with vector data the most sensible choice is generally a Gaussian kernel, but when the samples are time-series (or more generally sequences) custom kernels must be used. There are not many sensible choices, as merely using a classic dynamic time warping distance does not lead to a positive definite kernel.

To this end we propose the one-sided mean kernel, which has many advantages:

  • Provably positive definite,
  • Faster than competing techniques with a time complexity of O(l × (m - l)) instead of O(l × m) for sequences of length l < m,
  • Consistent with a vector kernel when time series are of equal length,
  • Does not suffer from issues of diagonal dominance like the global alignment kernel for example.

An implementation in Haskell is available here.

References

  • N. Chrysanthos, P. Beauseroy, H. Snoussi, E. Grall-Maës, Theoretical properties and implementation of the one-sided mean kernel for time series, in: Neurocomputing 169 (2015) 196–204
  • M. Cuturi, J.-P. Vert, O. Birkenes, T. Matsui, A kernel for time series based on global alignments, in: IEEE International Conference on Acoustics, Speech and Signal Processing, 2007
  • J.-P. Vert, The Optimal Assignment Kernel is not Positive Definite in: arXiv:0801. 4061

python-sequence-kernels's People

Contributors

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