tslearn.datasets.CachedDatasets

class tslearn.datasets.CachedDatasets[source]

A convenience class to access cached time series datasets.

When using the Trace dataset, please cite [1].

References

[1]A. Bagnall, J. Lines, W. Vickers and E. Keogh, The UEA & UCR Time Series Classification Repository, www.timeseriesclassification.com

Methods

list_datasets(self) List cached datasets.
load_dataset(self, dataset_name) Load a cached dataset from its name.
list_datasets(self)[source]

List cached datasets.

load_dataset(self, dataset_name)[source]

Load a cached dataset from its name.

Parameters:
dataset_name : str

Name of the dataset. Should be in the list returned by list_datasets

Returns:
numpy.ndarray of shape (n_ts_train, sz, d) or None

Training time series. None if unsuccessful.

numpy.ndarray of integers with shape (n_ts_train, ) or None

Training labels. None if unsuccessful.

numpy.ndarray of shape (n_ts_test, sz, d) or None

Test time series. None if unsuccessful.

numpy.ndarray of integers with shape (n_ts_test, ) or None

Test labels. None if unsuccessful.

Examples

>>> data_loader = CachedDatasets()
>>> X_train, y_train, X_test, y_test = data_loader.load_dataset(
...                                        "Trace")
>>> print(X_train.shape)
(100, 275, 1)
>>> print(y_train.shape)
(100,)