Skip to content

feat: add target normalization and feature scaling to EncoderDecoderD…#2022

Open
Mohima6 wants to merge 1 commit intosktime:mainfrom
Mohima6:patch-3
Open

feat: add target normalization and feature scaling to EncoderDecoderD…#2022
Mohima6 wants to merge 1 commit intosktime:mainfrom
Mohima6:patch-3

Conversation

@Mohima6
Copy link

@Mohima6 Mohima6 commented Jan 14, 2026

Description

  • Implemented target normalization using TorchNormalizer / RobustScaler in _preprocess_data.
  • Applied optional continuous feature scalers from self._scalers dictionary.
  • Added target_scale in the preprocessed data for decoder input.
  • Updated _ProcessedEncoderDecoderDataset.__getitem__ to use normalized target scale.
  • Ensures that all time series data fed into the model is scaled consistently, improving training stability.

Reference Issues/PRs

Fixes #1995 [ENH]


What does this implement/fix?

A clear and concise description:

Adds preprocessing for target normalization and feature scaling to improve model stability and training consistency.


Reviewer focus

  • Check that _preprocess_data correctly applies target normalization and feature scaling.
  • Verify that _ProcessedEncoderDecoderDataset.__getitem__ uses the normalized target_scale.
  • Confirm backward compatibility with unnormalized datasets.

Tests added

  • None yet (can add unit tests for _preprocess_data output consistency)
  • Recommended: verify target and features after preprocessing.

Other comments

  • This PR is part of the experimental rework for the PyTorch Forecasting D2 layer.
  • Feedback on edge cases and scaling behavior is especially appreciated.

…ataModule

- Implemented target normalization using TorchNormalizer/RobustScaler in `_preprocess_data`.
- Applied optional continuous feature scalers from `self._scalers` dictionary.
- Added `target_scale` in the preprocessed data for decoder input.
- Updated `_ProcessedEncoderDecoderDataset.__getitem__` to use normalized target scale.
- Ensures that all time series data fed into the model is scaled consistently, improving training stability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] Add Preprocessing Steps (Scaling/Transformations) to D2 Layer

1 participant