commonpower.data_forecasting.nn_forecasting.dataset_wrappers.DatasetWrapper

class DatasetWrapper(data_source: ~commonpower.data_forecasting.base.DataSource, data_split: ~commonpower.data_forecasting.nn_forecasting.data_splitting.DatasetSplit, model: ~commonpower.data_forecasting.nn_forecasting.models.NNModule, targets: list[str], features: list[str], feature_transform: ~commonpower.data_forecasting.nn_forecasting.transform.Transformation = <commonpower.data_forecasting.nn_forecasting.transform.IdentityTransform object>, target_transform: ~commonpower.data_forecasting.nn_forecasting.transform.Transformation = <commonpower.data_forecasting.nn_forecasting.transform.IdentityTransform object>)[source]

Bases: Dataset

DatasetWrappers determine how the train/val datasets are constructed. It acts as a wrapper around the data source and can be passed to a data loader as dataset.

Parameters:
  • data_source (DataSource) – The data source for the dataset.

  • data_split (DatasetSplit) – The split of the dataset.

  • model (NNModule) – The neural network model.

  • targets (list[str]) – The list of target variables.

  • features (list[str]) – The list of feature variables.

  • feature_transform (Transformation, optional) – The transformation to apply to the features. Defaults to IdentityTransform().

  • target_transform (Transformation, optional) – The transformation to apply to the targets. Defaults to IdentityTransform().

Returns:

DatasetWrapper – The initialized DatasetWrapper object.

Methods