Database
The user must provide a dataset (temporal, spatial, or spatio-temporal) and describe an experimental setup to adapt the toolbox for their research. The preprocessing must implemented within the dataset class, for which we provide a template based on a PyTorch wrapper, as well as several examples in the Tutorials section. Below is a description of the dataset class.
The initialization function receives the following parameters:
config: This parameter contains a dictionary with the data section of the configuration (yaml) file. See more details at Section 2 of Configuration File.
period: Parameter to specify the data split. Usage: The toolbox internally calls the Dataset class three times, the value of period will change from train to val and, finally, to test. Use this fixed value parameter to specify the data to be loaded per iteration.
Pyod Database Template
class Dataset(torch.utils.data.Dataset):
def __init__(self, config, period='train'):
# initialize the class and perform all the preprocessing
def __getallitems__(self, index):
# return the data and labels
Pytorch Database Template
class Dataset(torch.utils.data.Dataset):
def __init__(self, config, period='train'):
# initialize the class and perform all the preprocessing
def __getitem__(self, index):
# return the data and labels
def __len__(self):
# return the size of the dataset