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
Built Distribution
File details
Details for the file telescope_distance-0.0.2.tar.gz
.
File metadata
- Download URL: telescope_distance-0.0.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc98a5f14cdae6dfa3b924f6067d17567900d3b071414f1a0ce1bfafafef01d6 |
|
MD5 | fdabf778ac65b0536c1999fd025426e4 |
|
BLAKE2b-256 | 4bab67105f14afb6c7e4d47ade56a7f4a96bbd805ef852a262ed3f7fe052c513 |
File details
Details for the file telescope_distance-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: telescope_distance-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3015332ef32d2111f854dcf0604dd3647f2b11930e35ae329c5c86ae2c73ffec |
|
MD5 | 28b08da6dd45ebd57a0c647c26def7f4 |
|
BLAKE2b-256 | 9b63b6a685a6ab96cc68f3e5c87e404308aad035e41893bb9e45fb0881226968 |