Shortcuts

torchtime.datasets

Torchtime provides many built-in datasets in the torchtime.datasets module, as well as utility classes for building your own datasets.

Built-in datasets

All datasets are subclasses of torch.utils.data.Dataset i.e, they have __getitem__ and __len__ methods implemented. Hence, they can all be passed to a torch.utils.data.DataLoader which can load multiple samples in parallel using torch.multiprocessing workers. For example:

ucr_data = torchtime.datasets.UCR('path/to/ucr_root/', name='AbnormalHeartbeat')
data_loader = torch.utils.data.DataLoader(ucr_data,
                                          batch_size=4,
                                          shuffle=True,
                                          num_workers=args.nThreads)

All the datasets have almost similar API. They all have two common arguments: transform and target_transform to transform the input and target respectively. You can also create your own datasets using the provided base classes.

Time Series Classification

UCR

UEA & UCR Time Series Classification Repository [Dau et al., 2019].

Base classes for custom datasets

TimeSeriesDataset

Base class for making datasets which are compatible with torchtime.

PandasDataset

Base class for creating datasets which are compatible with torchtime from pandas.Dataframe.