Repository navigation
Normalize decoder targets when using EncoderNormalizer - #2457
Open
HarshRajSinghania wants to merge 2 commits into
Open
HarshRajSinghania wants to merge 2 commits into
HarshRajSinghania wants to merge 2 commits into
Conversation
EncoderDecoderTimeSeriesDataModule fitted EncoderNormalizer on the encoder window and applied it only to target_past. Decoder y stayed on the raw scale. Fit on the encoder window and transform y with that state so the forecast horizon is not used to fit the scale. Fixes sktime#2360
HarshRajSinghania
requested review from
benHeid,
fkiraly,
jdb78 and
phoeenniixx
as code owners
October 9, 2026 06:39
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2457 +/- ##
=======================================
Coverage ? 88.82%
=======================================
Files ? 218
Lines ? 11687
Branches ? 0
=======================================
Hits ? 10381
Misses ? 1306
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
EncoderDecoderTimeSeriesDataModule fitted EncoderNormalizer on the encoder window only, so y stayed on the raw scale. Apply that same fit to the decoder target. Fixes sktime#2360
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Normalize decoder targets when
EncoderDecoderTimeSeriesDataModuleuses a per-sequence target normalizer (EncoderNormalizer).Motivation
Fixes #2360. The dataset fitted
EncoderNormalizeron the encoder window and applied it only totarget_past.ystayed on the raw scale, so the training target did not match the normalized encoder history.Implementation
ScalerAdapter.transform_sequence, which reuses the state just fitted byfit_transform_sequenceand does not re-fit.__getitem__, fit on the encoder window and transform bothtarget_pastand the decoder target with that state. The forecast horizon is not used to fit the scale.Testing
python -m pytest tests/test_data/test_data_module.py -q -o addopts=— 43 passed, including newtest_encoder_normalizer_scales_decoder_target.ruff checkon the changed adapter, data module, and test file passed.The regression test checks that
yandtarget_pastmatch standard scaling fitted on the encoder window only (mean and unbiased std, plus float epsilon).