timesead.data.transforms.dataset_source ======================================= .. py:module:: timesead.data.transforms.dataset_source Classes ------- .. autoapisummary:: timesead.data.transforms.dataset_source.DatasetSource Functions --------- .. autoapisummary:: timesead.data.transforms.dataset_source.make_dataset_split Module Contents --------------- .. py:class:: DatasetSource(dataset: timesead.data.dataset.BaseTSDataset, start: Union[int, List[int]] = None, end: Union[int, List[int]] = None, axis: str = 'batch') Bases: :py:obj:`timesead.data.transforms.transform_base.Transform` This acts as a source :class:`~timesead.data.transforms.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. :param dataset: The dataset from which to take points. :param start: Start index for this dataset. Please see below for a more detailed explanation. :param end: End index for this dataset (exclusive). Please see below for a more detailed explanation. :param axis: 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`. .. py:attribute:: dataset .. py:attribute:: axis :value: 'batch' .. py:method:: __len__() This should return the number of available sequences after the transformation. .. py: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`. .. py:property:: num_features Number of features of each datapoint. This can also be a tuple if the data has more than one feature dimension. .. py:function:: make_dataset_split(dataset: timesead.data.dataset.BaseTSDataset, *splits: float, axis: str = 'batch') Create :class:`DatasetSource`\s for different parts of a given dataset. :param dataset: The dataset, for which the split should be done. :param splits: This should be the percentages of the dataset in each split. Will be normalized to 100%. :param axis: The axis along which to split the dataset. Please see :class:`DatasetSource` for a more detailed explanation. :return: This will return a generator that yields :class:`DatasetSource`\s according to the specified splits.