split_by_dates#

openstef_models.utils.data_split.split_by_dates(dataset: T, dates_test: DatetimeIndex) tuple[T, T][source]#

Split a dataset into train and test sets based on specific dates.

Parameters:
  • dataset (TypeVar(T, bound= TimeSeriesDataset)) – The dataset to split.

  • dates_test (DatetimeIndex) – Dates to include in the test set. All other dates go to training.

  • dataset

  • dates_test

Returns:

Tuple of (train_dataset, test_dataset).

Return type:

tuple[TypeVar(T, bound= TimeSeriesDataset), TypeVar(T, bound= TimeSeriesDataset)]