Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply WindowStatisticsTransform to regressors #474

Merged
merged 5 commits into from
Sep 12, 2024
Merged

Apply WindowStatisticsTransform to regressors #474

merged 5 commits into from
Sep 12, 2024

Conversation

egoriyaa
Copy link
Collaborator

@egoriyaa egoriyaa commented Sep 9, 2024

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Proposed Changes

Closing issues

closes #473

@egoriyaa egoriyaa self-assigned this Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

🚀 Deployed on https://deploy-preview-474--etna-docs.netlify.app

@github-actions github-actions bot temporarily deployed to pull request September 9, 2024 13:28 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 9, 2024 13:37 Inactive
@@ -136,6 +141,12 @@ class MeanTransform(WindowStatisticsTransform):

.. math::
MeanTransform(x_t) = \\sum_{i=1}^{window}{x_{t - i}\\cdot\\alpha^{i - 1}}

This transform, applied to non-regressor column, generates non-regressor column.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should wrap this in a warning block like this:

Warning
-------

For reference, look at ChangePointsTrendTransform.

@@ -59,6 +60,10 @@ def __init__(
def fit(self, ts: TSDataset) -> "WindowStatisticsTransform":
"""Fit the transform."""
self.in_column_regressor = self.in_column in ts.regressors
if not self.in_column_regressor:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should give this warning.
A fairly valid approach is to apply MeanTransform to target and then apply LagTransform to the result. It will be strange to force someone to change the order if everything is fine.

However, with new warning we could draw users' attention to the issue. Failed tests are also bothering me, some of them could be problematic and probably should be fixed.

  • Keep this warning for a while (we will remove it a little bit later, see second step).
  • Fix only the tests where we create a pipeline without lag applied to window transform.
  • Ask for re-review (after that we probably remove this warning).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, we could remove this warning and make other suggested changes.

CHANGELOG.md Outdated
@@ -24,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
-
-
-
- Update docstings of `WindowStatisticsTransform`'s parents ([#469](https://github.com/etna-team/etna/pull/474))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should give some more clarification: Add docstring warning about handling non-regressors (including target) to children of WindowStatisticsTransform

@github-actions github-actions bot temporarily deployed to pull request September 11, 2024 09:43 Inactive
@github-actions github-actions bot temporarily deployed to pull request September 12, 2024 09:15 Inactive
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.60%. Comparing base (7ad2e61) to head (32fa6cb).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #474   +/-   ##
=======================================
  Coverage   90.60%   90.60%           
=======================================
  Files         247      247           
  Lines       16481    16481           
=======================================
  Hits        14933    14933           
  Misses       1548     1548           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@egoriyaa egoriyaa merged commit 0f98ec0 into master Sep 12, 2024
17 checks passed
@egoriyaa egoriyaa deleted the issue-473 branch September 12, 2024 10:02
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.

[DOCS] Apply WindowStatisticsTransform to regressors
2 participants