commonpower.data_forecasting.nn_forecasting.data_splitting.DatasetSplit

class DatasetSplit(split_type: DataSplitType, data_source: DataSource, model: NNModule)[source]

Bases: object

DataSplits are used to split the dataset into training, validation, and test sets. They do that by adjusting the index when accessing the dataset.

Parameters:
Returns:

DatasetSplit – The initialized DatasetSplit object.

Methods

adjust_index

Adjusts the index to the correct position in the dataset.

adjust_index(idx: int) int[source]

Adjusts the index to the correct position in the dataset.

Parameters:

idx (int) – Index.

Returns:

int – Adjusted index.