A machine learning toolkit dedicated to time-series data
Project description
tslearn is a Python package that provides machine learning tools for the analysis of time series.
This package builds on scikit-learn, numpy and scipy libraries.
If you would like to contribute to tslearn, please have a look at our contribution guidelines.
Dependencies
Cython
numpy
numba
scipy
scikit-learn
joblib
numba
If you plan to use the shapelets module, keras and tensorflow should also be installed.
Installation
Pre-requisites
C++ build tools should be available to perform installation.
Using conda
The easiest way to install tslearn is probably via conda:
conda install -c conda-forge tslearn
Using PyPI
Using pip should also work fine:
pip install tslearn
In this case, you should have numpy, cython and C++ build tools available
at build time.
Using latest github-hosted version
If you want to get tslearn's latest version, you can refer to the repository
hosted at github:
pip install git+https://github.com/rtavenar/tslearn.git
In this case, you should have numpy, cython and C++ build tools available
at build time.
Documentation and API reference
The documentation, including a gallery of examples, is hosted at readthedocs.
Already available
- A
generatorsmodule provides Random Walks generators - A
datasetsmodule provides access to the famous UCR/UEA datasets through theUCR_UEA_datasetsclass - A
preprocessingmodule provides standard time series scalers - A
metricsmodule provides:- Dynamic Time Warping (DTW) (with Sakoe-Chiba band and Itakura parallelogram variants)
- LB_Keogh
- Global Alignment Kernel
- Soft-DTW from Cuturi and Blondel
- A
neighborsmodule includes nearest neighbor algorithms to be used with time series - An
svmmodule includes Support Vector Machine algorithms with:- Standard kernels offered in
sklearn(with adequate array reshaping done for you) - Global Alignment Kernel
- Standard kernels offered in
- A
clusteringmodule includes the following time series clustering algorithms:- Standard Euclidean k-means (with adequate array reshaping done for you)
- Based on
tslearn.barycenters
- Based on
- DBA k-means from Petitjean et al.
- Based on
tslearn.barycentersthat offers DBA facility that could be used for other applications than just k-means
- Based on
- Global Alignment kernel k-means
- KShape clustering from Paparizzos and Gravano
- Soft-DTW k-means from Cuturi and Blondel
- Based on
tslearn.barycentersthat offers Soft-DTW barycenter computation
- Based on
- It also provides a way to compute the silhouette coefficient for given clustering and metric
- Standard Euclidean k-means (with adequate array reshaping done for you)
- A
shapeletsmodule includes an efficient implementation of the Learning Time-Series method from Grabocka et al.- Warning: to use the
shapeletsmodule, two extra dependencies are required:kerasandtensorflow
- Warning: to use the
- A
piecewisemodule includes standard time series transformations, as well as the corresponding distances:- Piecewise Aggregate Approximation (PAA)
- Symbolic Aggregate approXimation (SAX)
- 1d-Symbolic Aggregate approXimation (1d-SAX)
TODO list
Have a look there for a list of suggested features. If you want other ML methods for time series to be added to this TODO list, do not hesitate to open an issue! See our contribution guidelines for more information about how to proceed.
Acknowledgments
Authors would like to thank Mathieu Blondel for providing code for
Kernel k-means and Soft-DTW (both
distributed under BSD license) that are used in the clustering and metrics modules of this library.
Referencing tslearn
If you use tslearn in a scientific publication, we would appreciate citations:
@misc{tslearn,
title={tslearn: A machine learning toolkit dedicated to time-series data},
author={Tavenard, Romain and Faouzi, Johann and Vandewiele, Gilles},
year={2017},
note={\url{https://github.com/rtavenar/tslearn}}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tslearn-0.2.4.tar.gz.
File metadata
- Download URL: tslearn-0.2.4.tar.gz
- Upload date:
- Size: 520.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d60fdbf70e767cfa2b311c0a8b70e8efa4c26b7cb0eaedc883bfcd70e3643bc4
|
|
| MD5 |
64e346dab252bdeae0c521c886a947b3
|
|
| BLAKE2b-256 |
8460fa37cebd63daf2d37186d87eca08fdc4de183facade1501d0385de0dbb50
|