restore_target#
- openstef_models.models.forecasting_model.restore_target(dataset: T, original_dataset: TimeSeriesDataset, target_column: str) T[source]#
Restore the target column from the original dataset to the given dataset.
Maps target values from the original dataset to the dataset using index alignment. Preserves NaN values that were introduced by the OutlierHandler (identified via sentinel columns) so that outlier rows can be excluded from training.
- Parameters:
dataset (
TypeVar(T, bound=TimeSeriesDataset)) – Dataset to modify by adding the target column.original_dataset (
TimeSeriesDataset) – Source dataset containing the target values.target_column (
str) – Name of the target column to restore.dataset
original_dataset
target_column
- Returns:
Dataset with the target column restored from the original dataset, except where the OutlierHandler introduced NaN.
- Return type:
TypeVar(T, bound=TimeSeriesDataset)