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.
Cython
numpy
scipy
scikit-learn
The easiest way to install tslearn is probably via pip:
pip install tslearnIf you want to get tslearn's latest version, you can git clone the repository hosted at github:
git clone https://github.com/rtavenar/tslearn.gitThen, you should run the following command for Cython code to compile:
python setup.py build_ext --inplaceAlso, for the whole package to run properly, its base directory should be appended to your Python path.
- 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 domain adaptation for time series module named
adaptationcontains:- a method for DTW-based non linear resampling that was previously released in
dtw_resamplerepo
- a method for DTW-based non linear resampling that was previously released in
- A
neighborsmodule includes nearest neighbor algorithms to be used with time series - 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
- Standard Euclidean k-means (with adequate array reshaping done for you)
- 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)
- Implement Learning Shapelets from Grabocka et al.
- Add local feature extractors (
TransformerMixin) and Bag-of-Word models - Add metric learning for time series (Garreau et al.)
- Add LB_Keogh for nearest neighbor search
If you want other ML methods for time series to be added to this TODO list, do not hesitate to open an issue!
Author would like to thank Mathieu Blondel for providing code for Kernel k-means and Soft-DTW (both distributed under BSD license) that is used in the clustering module of this library.