Repository navigation
v0.10.0
Added
- New
tslearn.foundationmodule to re-use pre-trained time series models, such as
the ones published on the Hugging Face Hub, behind the usual tslearn API. It provides
ZeroShotForecaster,LinearProbeForecasterand the underlying
TimeSeriesFoundationEmbedderfeature extractor, which allows one to choose
the probed layer, the tokens taken into account and the pooling applied to their
representations. Withpooling=None, the latter acts as a time series to time series
transform, returning one representation per token, and being a regular scikit-learn
transformer, it composes with asklearn.pipeline.Pipelinefor tasks such as linear
probing for classification. Requires PyTorch. - soft-dtw related tools now support Itakura and Sakoe-Chiba global constraints. (#189)
- Multithreading support added to
cdist_soft_dtwandsoftdtw_barycenter. (#310) TimeSeriesScalerMinMaxandTimeSeriesScalerMeanVariancenow offer an inverse_transform method
to reverse the normalization. (#697)tslearn.forecasting.ScaledForecastingPipelinewraps a forecaster so that it is fitted on scaled data and
its predictions are un-scaled back, using anytslearn.preprocessingscaler. (#708)- Added
tslearn.clustering.silhouette_samplesto compute per-sample silhouette coefficients with time-series metrics. (#451) SymbolicAggregateApproximationandOneD_SymbolicAggregateApproximationcan now handle variable lengths
Removed
- Support for sklearn version 1.4 is dropped
Changed
- soft-dtw API is now consistent with other metrics regarding parameters names and backend management.
tslearnclasses and functions can be used with top level import.
Fixed
- Correct the discrete segment center in 1d-SAX distances, preserving the
representative average when the slope is nonzero. masenow scales each feature by its own in-sample naive forecast error, so thatmultioutput="uniform_average"and array-likemultioutputaggregate the per-feature values returned withmultioutput="raw_values"(a NumPy arraymultioutputpreviously raisedValueError). The NaN padding of variable lengthtrain_datais now ignored instead of making the resultNaN.lcssandlcss_path_from_metricnow respect theglobal_constraint/ Sakoe-Chiba / Itakura band, which was previously ignored. (#526)gakandcdist_gakno longer returnNaNfor time series longer than about 405 samples. They are now normalized in log space, and the Global Alignment Kernel recursion falls back to a log-space accumulation when its value leaves the range of a 64-bit float. This also fixesTimeSeriesSVC/TimeSeriesSVRandKernelKMeanswithkernel="gak"on long time series. (#450)- Fixed double scaling in
OneD_SymbolicAggregateApproximation. (#722) cdist_frechetnow respectsglobal_constraint, which was previously ignored. (#726)TimeSeriesSVRnow passesepsilonon to the underlyingsklearn.svm.SVR, which was previously ignored so the epsilon-tube width was always the sklearn default. (#727)TimeSeriesImputer(method="linear")no longer raisesValueErrorwhen a feature of a time series has no observed value. Such features are now left unchanged, as for the other imputation methods.PiecewiseAggregateApproximation.distance,SymbolicAggregateApproximation.distanceandOneD_SymbolicAggregateApproximation.distancenow accept two time series of different lengths, instead of failing on the ragged input. (#738)VARIMAandAutoVARIMAforecasts with a differencing orderdof 2 or more are now integrated back correctly. They were previously integrated as ifdwere 1.dtw_barycenter_averaging_subgradientnow takesweightsinto account (they cancelled out in each update step), no longer returns NaN when a weight is 0, and stops based on the weighted cost over the whole epoch. (#764)- Performance metrics now check inputs shape consistency (#771)
VARIMAandAutoVARIMAforecasts are now correct for multivariate series, which previously applied the transpose of the fitted autoregressive matrices.ma_coeffs_[k]is now the lagk + 1term, in the same order asar_coeffs_. (#762)NonMyopicEarlyClassifiernow normalizes the confusion matrices stored inpyhatyck_over the predicted classes, so that they hold the documented probabilities of predictingy_hatgiven the true classyand the cluster. They were previously normalized over the true classes, which gave wrong expected misclassification costs and therefore wrong prediction times. (#778)