Skip to content

Commit

Permalink
updated inference tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brsnw250 committed Jul 25, 2024
1 parent 915afe6 commit a3b90ac
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from etna.transforms import EventTransform
from etna.transforms import ExogShiftTransform
from etna.transforms import FilterFeaturesTransform
from etna.transforms import FourierDecomposeTransform
from etna.transforms import FourierTransform
from etna.transforms import GaleShapleyFeatureSelectionTransform
from etna.transforms import HolidayTransform
Expand Down Expand Up @@ -141,6 +142,7 @@ def _test_inverse_transform_train(self, ts, transform, expected_changes):
"regular_ts",
{},
),
(FourierDecomposeTransform(in_column="target", k=5, residuals=True), "regular_ts", {}),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -602,6 +604,7 @@ def test_inverse_transform_train_fail_resample(self, transform, dataset_name, ex
"regular_ts",
{},
),
(FourierDecomposeTransform(in_column="target", k=5, residuals=True), "regular_ts", {}),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -1093,6 +1096,7 @@ def _test_inverse_transform_train_subset_segments(self, ts, transform, segments)
),
"regular_ts",
),
(FourierDecomposeTransform(in_column="target", k=5, residuals=True), "regular_ts"),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -1378,6 +1382,8 @@ def _test_inverse_transform_future_subset_segments(self, ts, transform, segments
),
"regular_ts",
),
(FourierDecomposeTransform(in_column="target", k=5, residuals=True), "regular_ts"),
(FourierDecomposeTransform(in_column="positive", k=5, residuals=True), "ts_with_exog"),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -2589,6 +2595,7 @@ def _test_inverse_transform_future_with_target(
"regular_ts",
{},
),
# (FourierDecomposeTransform(in_column="target", k=5, residuals=True), "regular_ts", {}),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -3096,6 +3103,8 @@ def _test_inverse_transform_future_without_target(
"regular_ts",
{},
),
(FourierDecomposeTransform(in_column="target", k=5, residuals=True), "regular_ts", {}),
(FourierDecomposeTransform(in_column="positive", k=5, residuals=True), "ts_with_exog", {}),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down
25 changes: 25 additions & 0 deletions tests/test_transforms/test_inference/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from etna.transforms import EventTransform
from etna.transforms import ExogShiftTransform
from etna.transforms import FilterFeaturesTransform
from etna.transforms import FourierDecomposeTransform
from etna.transforms import FourierTransform
from etna.transforms import GaleShapleyFeatureSelectionTransform
from etna.transforms import HolidayTransform
Expand Down Expand Up @@ -127,6 +128,11 @@ def _test_transform_train(self, ts, transform, expected_changes):
"regular_ts",
{"create": {"res"}},
),
(
FourierDecomposeTransform(in_column="target", k=2, residuals=True),
"regular_ts",
{"create": {"target_dft_0", "target_dft_1", "target_dft_residuals"}},
),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -544,6 +550,11 @@ def test_transform_train_datetime_timestamp(self, transform, dataset_name, expec
"regular_ts",
{"create": {"res"}},
),
(
FourierDecomposeTransform(in_column="target", k=2, residuals=True),
"regular_ts",
{"create": {"target_dft_0", "target_dft_1", "target_dft_residuals"}},
),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -1049,6 +1060,7 @@ def _test_transform_train_subset_segments(self, ts, transform, segments):
),
"regular_ts",
),
(FourierDecomposeTransform(in_column="target", k=2, residuals=True), "regular_ts"),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -1316,6 +1328,8 @@ def _test_transform_future_subset_segments(self, ts, transform, segments, horizo
),
"regular_ts",
),
(FourierDecomposeTransform(in_column="target", k=2, residuals=True), "regular_ts"),
(FourierDecomposeTransform(in_column="positive", k=2, residuals=True), "ts_with_exog"),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -2420,6 +2434,7 @@ def _test_transform_future_with_target(self, ts, transform, expected_changes, ga
"regular_ts",
{"create": {"res"}},
),
# (FourierDecomposeTransform(in_column="target", k=2, residuals=True), "regular_ts", {"create": {"target_dft_0", "target_dft_1", "target_dft_residuals"}}),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down Expand Up @@ -2859,6 +2874,16 @@ def _test_transform_future_without_target(self, ts, transform, expected_changes,
"regular_ts",
{"create": {"res"}},
),
(
FourierDecomposeTransform(in_column="target", k=2, residuals=True),
"regular_ts",
{"create": {"target_dft_0", "target_dft_1", "target_dft_residuals"}},
),
(
FourierDecomposeTransform(in_column="positive", k=2, residuals=True),
"ts_with_exog",
{"create": {"positive_dft_0", "positive_dft_1", "positive_dft_residuals"}},
),
# embeddings
(
EmbeddingSegmentTransform(
Expand Down

0 comments on commit a3b90ac

Please sign in to comment.