Skip to main content

Time-series clustering based on telescope distance

Project description

telescope-distance

Telescope-distance is a Python package for time-series clustering based on the telescope distance [1] as a metric over the space of infinite dimensional measures.

Installation

Dependencies

telescope-distance requires:

  • Python (>= 3.5)
  • NumPy
  • SciPy
  • SciKit-learn

User installation

Make sure that you have Python 3.5+ and pip installed. We recommend installing the stable version of telescope-distance with pip:

$ pip install telescope-distance

Alternatively, you can also clone the source of the latest version with:

$ git clone https://github.com/soheil-arab/telescope-distance

Then install directly from source with:

$ python setup.py install    

Examples

A short example is as below.

import functools
from sklearn import svm
from telescope_distance import telescope
from telescope_distance.generators import generators

#generates two sample path from two arbitrary 3rd order markov chain 
mc_1 = generators.MarkovChain(2,3) 
x = mc_1.generate_sample_path(1000)
mc_2 = generators.MarkovChain(2,3)
y = mc_2.generate_sample_path(1000)

weights_fn = lambda k: k**-2
clf_constructor = functools.partial(svm.SVC,
                                    kernel='rbf',
                                    max_iter=-1)
TD = telescope.TelescopeDistance(clf_constructor, weights_fn)

print(f'empirical estimate of TD between MC_1 and MC_2 is {TD.distance(x,y)}')

References

[1] Ryabko, Daniil, and Jérémie Mary. "A binary-classification-based metric between time-series distributions and its use in statistical and learning problems." The Journal of Machine Learning Research 14.1 (2013): 2837-2856.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telescope_distance-0.0.3.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

telescope_distance-0.0.3-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file telescope_distance-0.0.3.tar.gz.

File metadata

  • Download URL: telescope_distance-0.0.3.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.5

File hashes

Hashes for telescope_distance-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0c932716921b834d66d792161c1fd64874f24e8d7bbbb58ce5135537d8d92d31
MD5 ae9f32171ffe7c2f17e1fa6285a0b782
BLAKE2b-256 838000607693616ee6970296e0e5728ed2b51186bfadd9c71a1a84748a8a1689

See more details on using hashes here.

File details

Details for the file telescope_distance-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for telescope_distance-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 932a90bab1ee35f6b150147914f091956a9cfd67f7d9d8b477aaa6a35e9b20fa
MD5 1c0a2d7e1b8259a025717447503ab9f1
BLAKE2b-256 1b35740bc775fdd022089cbb5d5b5df7be162c63f891f691a7e026adb5383647

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page