train_val_test_split#
- openstef_models.utils.data_split.train_val_test_split[T](dataset: T, split_func: Callable[[T, float], tuple[T, T]], val_fraction: float, test_fraction: float) tuple[T, T, T][source]#
Split a dataset into train, validation, and test sets chronologically.
Divides the dataset into training, validation, and testing sets based on temporal order, ensuring that all training data comes before all validation data, which comes before all testing data.
The split points are determined by the val_fraction and test_fraction parameters.
- Parameters:
- Return type:
tuple[T,T,T]- Returns:
Tuple of (train_dataset, val_dataset, test_dataset).
- Raises:
ValueError – If test_fraction + val_fraction is not less than 1.0.