Shortcuts

TimeSeriesDataset

class torchtime.datasets.TimeSeriesDataset(root: str, transforms: Optional[Callable] = None, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None)[source]

Base class for making datasets which are compatible with torchtime. It is necessary to override the __getitem__ and __len__ method.

Parameters:
  • root (string) – Root directory of dataset.

  • transforms (callable, optional) – A function/transforms that takes in a time series and a label and returns the transformed versions of both.

  • transform (callable, optional) – A function/transform that takes in a uni- or multivariate time series and returns a transformed version. E.g, transforms.NaN2Value

  • target_transform (callable, optional) – A function/transform that takes in the target and transforms it.

Note

transforms and the combination of transform and target_transform are mutually exclusive.

__getitem__(index: int) Tuple[Any, Any][source]
Parameters:

index (int) – Index

Returns:

(series, target) where target is index of the target class.

Return type:

tuple