All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Changelogs for this project are recorded in this file since v0.2.0.
- Rework
cdist_dtwand underlying Numba jited DTW computation to speed things up for numpy Backends. - Masks as returned by
compute_mask,sakoe_chiba_maskanditakura_masknow have boolean values. - Backend attributes are now dynamic.
- Ensure dtype is preserved in to_time_series_dataset
- Fixed centroids computations in K-shape for multivariate timeseries (#288)
- Fixed json and pickle serialization for LearningShapelet (#387)(#403)
- DBSCAN estimator for timeseries (#598)
- Explicit exception when using Global Alignment Kernel with sigma close to zero (#440)
- Fixed shifting in K-shape shape extraction process (#385)
- Support for
scikit-learnup to 1.7 (#549) - Fixed
LearningShapeletswith variable length timeseries (#352) - The
shapeletsmodule now depends on Keras3+ and the underlying backend can be selected through the KERAS_BACKEND environment variable. Defaults to the first found installed backend amongtorch,tensorflowandjax(in that order).
- Support for Python versions 3.8 and 3.9 is dropped
per_timeseriesandper_featureoptions for min-max and mean-variance scalers (#536)TimeSeriesImputerclass: missing value imputer for time series (#564)- Frechet metrics and KNeighbors integration (#402)
- Support for
scikit-learnup to 1.6
- The structure of the class
Backendhas been simplified.
- Option
compute_with_backendin functionssoft_dtw,soft_dtw_alignment,cdist_soft_dtwandcdist_soft_dtw_normalized.PyTorchautomatic differentiation can now be used when these functions are using thePyTorchbackend.
- Fixed error in
LearningShapeletswhen input parametern_shapelets_per_sizeequalsNone. - Fixed bug related to
SoftDTWLossPytorchwith optionnormalize=Truewhen used on inputs of different lengths. - Fixed error in function
from_hdf5for array inputs. - Fixed
readthedocstest failing by replacingbuild.image(deprecated) withbuild.os.
- Fixed an incorrect calculation of the normalization term for
cdist_soft_dtw_normalizedwhendataset2is provided. - Fixed UCR/UEA datasets download link
- Fixed an import error when
torchis not installed. This error appeared in tslearn v0.6.PyTorchis now an optional dependency.
- Support of the
PyTorchbackend for the metrics oftslearn. In particular, the Dynamic Time Warping (DTW) metric and the Soft-DTW metric now support thePyTorchbackend.
- Support for Python version 3.7 is dropped
- Elements that were deprecated in v0.4 are now removed, as announced
- Support for
macOS-10.15is replaced by support formacOS-12 - Support for
scikit-learn 0.23is replaced by support forscikit-learn 1.0 - Specify supported
TensorFlowversion (2.9.0)
- Support for Python versions 3.9 and 3.10
- Fixed a bug about result of path in
lcss_path_from_metricfunction - Fixed incompatibilities between
NumPy,TensorFlowandscikit-learnversions - Fixed a bug preventing tslearn installation by removing the
NumPyversion constraint (<=1.19) in the filepyproject.toml
- Cython is now replaced by Numba
- Support for Python versions 3.5 and 3.6 is dropped
- In docs, change references to
masterbranch tomainbranch.
- Code refactoring to have all subpackages in subfolders
- Improved warnings in
datasetsloading shapeletsmodule is now compatible withtensorflow2.4
- Added canonical time warping (
ctwandctw_path) soft_dtw_alignmentprovides soft alignment path for soft-dtwlcssis a similarity measure based on the longest common subsequencelcss_path_from_metricallows one to pick a dedicated ground metric on top of which the LCSS algorithm can be run
- numpy array hyper-parameters can now be serialized using
to_*()methods - avoid
DivisionByZeroinMinMaxScaler - Fixed incompatibilities with
scikit-learn0.24
- k-means initialization function within
clustering/kmeans.pyupdated to be compatible withscikit-learn0.24 - Better initialization schemes for
TimeSeriesKMeansthat lead to more consistent clustering runs (helps avoid empty cluster situations) TimeSeriesScalerMeanVarianceandTimeSeriesScalerMinMaxare now completely sklearn-compliant- The
shapeletsmodule now requires tensorflow>=2 as dependency (was keras tensorflow==1.* up to version 0.3) GlobalAlignmentKernelKMeansis deprecated in favor ofKernelKMeansthat accepts various kernels (and "gak" is the default)ShapeletModelis now calledLearningShapeletsto be more explicit about which shapelet-based classifier is implemented.ShapeletModelis still available as an alias, but is now considered part of the private API
- Python 3.8 support
dtw_path_from_metricallows one to pick a dedicated ground metric on top of which the DTW algorithm can be run- Nearest Neighbors on SAX representation (with custom distance)
- Calculate pairwise distance matrix between SAX representations
PiecewiseAggregateApproximationcan now handle variable lengthsShapeletModelis now serializable to JSON and pickle formats- Multivariate datasets from the UCR/UEA archive are now available through
UCR_UEA_datasets().load_dataset(...) ShapeletModelnow accepts variable-length time series dataset; amax_sizeparameter has been introduced to save room at fit time for possibly longer series to be fed to the model afterwardsShapeletModelnow accepts ascaleparameter that drives time series pre-processing for better convergenceShapeletModelnow has a publichistory_attribute that stores loss and accuracy along fit epochs- SAX and variants now accept a
scaleparameter that drives time series pre-processing to fit the N(0,1) underlying hypothesis for SAX TimeSeriesKMeansnow has atransformmethod that returns distances to centroids- A new
matrix_profilemodule is added that allowsMatrixProfileto be computed using the stumpy library or using a naive "numpy" implementation. - A new
early_classificationmodule is added that offers early classification estimators - A new
neural_networkmodule is added that offers Multi Layer Perceptron estimators for classification and regression
- Estimators that can operate on variable length time series now allow for test time datasets to have a different length from the one that was passed at fit time
- Bugfix in
kneighbors()methods.
- Support for Python 2 is dropped
- Fixed a bug in
TimeSeriesSVCandTimeSeriesSVRthat caused user-inputgammato be ignored (always treated as if it were"auto") forgakkernel
dtw_barycenter_averagingis made faster by using vectorized computationsdtw_barycenter_averagingcan be restarted several times to reach better local optima using a parametern_initset to 1 by default- Functions
load_timeseries_txtandsave_timeseries_txtfrom the utils module have changed their names toload_time_series_txtandsave_time_series_txt. Old names can still be used but considered deprecated and removed from the public API documentation for the sake of harmonization - Default value for the maximum number of iterations to train
ShapeletModelandSerializableShapeletModelis now set to 10,000 (used to be 100) TimeSeriesScalerMeanVarianceandTimeSeriesScalerMinMaxnow ignore any NaNs when calling their respectivetransformmethods in order to better mirror scikit-learn's handling of missing data in preprocessing.KNeighborsTimeSeriesnow accepts variable-length time series as inputs when used with metrics that can deal with it (eg. DTW)- When constrained DTW is used, if the name of the constraint is not given but its parameter is set, that is now considered sufficient to identify the constraint.
KNeighborsTimeSeriesRegressoris a new regressor based on k-nearest-neighbors that accepts the same metrics asKNeighborsTimeSeriesClassifier- A
set_weightsmethod is added to theShapeletModeland
SerializableShapeletModelestimators subsequence_pathandsubsequence_cost_matrixare now part of the public API and properly documented as such with an example use case in which more than one path could be of interest (cf.plot_sdtw.py)verboselevels can be set for all functions / classes that usejoblibfor parallel computations andjobliblevels are used;- conversion functions are provided in the
utilsmodule to interact with other Python time series packages (pyts,sktime,cesium,seglearn,tsfresh,stumpy,pyflux) dtw_barycenter_averaging_subgradientis now available to compute DTW barycenter based on subgradient descentdtw_limited_warping_lengthis provided as a way to compute DTW under upper bound constraint on warping path lengthBaseModelPackageis a base class for serializing models to hdf5, json and pickle. h5py is added to requirements for hdf5 support.BaseModelPackageis used to add serialization functionality to the following models:GlobalAlignmentKernelKMeans,TimeSeriesKMeans,KShape,KNeighborsTimeSeries,KNeighborsTimeSeriesClassifier,PiecewiseAggregateApproximation,SymbolicAggregateApproximation, andOneD_SymbolicAggregateApproximation
- The
testssubdirectory is now made a python package and hence included in wheels
- The way version number is retrieved in
setup.pywas not working properly on Python 3.4 (and made the install script fail), switched back to the previous version
- A
RuntimeWarningis raised when an'itakura'constraint is set that is unfeasible given the provided shapes.
'itakura'and'sakoe_chiba'were swapped inmetrics.compute_mask
tslearnestimators are now automatically tested to matchsklearnrequirements "as much as possible" (cf.tslearnneeds in terms of data format, etc.)cdist_dtwandcdist_gaknow have an_jobsparameter to parallelize distance computations usingjoblib.Paralleln_jobsis also available as a prameter insilhouette_score,TimeSeriesKMeans,KNeighborsTimeSeries,KNeighborsTimeSeriesClassifier,TimeSeriesSVC,TimeSeriesSVRandGlobalAlignmentKernelKMeans
- Faster DTW computations using
numba tslearnestimators can be used in conjunction withsklearnpipelines and cross-validation tools, even (for those concerned) with variable-length data- doctests have been reduced to those necessary for documentation purposes, the
other tests being moved to
tests/*.py - The list of authors for the
tslearnbibliographic reference has been updated to include Johann Faouzi and Gilles Van de Wiele - In
TimeSeriesScalerMinMax,minandmaxparameters are now deprecated in favor ofvalue_range. Will be removed in v0.4 - In
TimeSeriesKMeansandsilhouette_score,'gamma_sdtw'is now deprecated as a key formetric_paramsin favor ofgamma. Will be removed in v0.4
- Barycenter methods implemented as estimators are no longer provided: use
dedicated functions from the
tslearn.barycentersmodule instead