timesead.data.transforms.dataset_source
Classes
This acts as a source |
Functions
|
Create |
Module Contents
- class timesead.data.transforms.dataset_source.DatasetSource(dataset: timesead.data.dataset.BaseTSDataset, start: int | List[int] = None, end: int | List[int] = None, axis: str = 'batch')
Bases:
timesead.data.transforms.transform_base.TransformThis acts as a source
Transform(meaning it has no parent) that simply returns sequences from a given dataset. It can be constrained to return only a specific part of the data.- Parameters:
dataset (timesead.data.dataset.BaseTSDataset) – The dataset from which to take points.
start (Union[int, List[int]]) – Start index for this dataset. Please see below for a more detailed explanation.
end (Union[int, List[int]]) – End index for this dataset (exclusive). Please see below for a more detailed explanation.
axis (str) – Can be either ‘batch’ or ‘time’. In ‘batch’ mode, this simply returns only the sequences indexed from start to end. ‘time’ mode is used for datasets that contain only one long time series. That time series will be cut according to start and end.
- dataset
- axis = 'batch'
- __len__()
This should return the number of available sequences after the transformation.
- property seq_len
This should return the length of each time series. If the time series have different lengths, the return value should be a list that contains the length of each sequence. If all sequences are of equal length, this should return an int.
- property num_features
Number of features of each datapoint. This can also be a tuple if the data has more than one feature dimension.
- timesead.data.transforms.dataset_source.make_dataset_split(dataset: timesead.data.dataset.BaseTSDataset, *splits: float, axis: str = 'batch')
Create
DatasetSources for different parts of a given dataset.- Parameters:
dataset (timesead.data.dataset.BaseTSDataset) – The dataset, for which the split should be done.
splits (float) – This should be the percentages of the dataset in each split. Will be normalized to 100%.
axis (str) – The axis along which to split the dataset. Please see
DatasetSourcefor a more detailed explanation.
- Returns:
This will return a generator that yields
DatasetSources according to the specified splits.