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
Rolling Mean features for time series #3028
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3028 +/- ##
=======================================
+ Coverage 99.8% 99.8% +0.1%
=======================================
Files 313 313
Lines 30490 30567 +77
=======================================
+ Hits 30400 30477 +77
Misses 90 90
Continue to review full report at Codecov.
|
836955e
to
d22d9aa
Compare
a98f7d7
to
667d943
Compare
gap=self.start_delay, | ||
min_periods=size + 1, | ||
) | ||
rolling_mean = rolling_mean.get_function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried computing the features with dfs but I think it's a bit awkward/confusing to have one set of features go through featuretools while the other does not: #3088
I spoke with the featuretools team, and it's probably best to wait until they release Lagged rolling primitives so we can refactor the whole component to use dfs at that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this just needs a few docstring changes! Great work!
@@ -59,6 +66,7 @@ def __init__( | |||
gap=0, | |||
forecast_horizon=1, | |||
conf_level=0.05, | |||
rolling_window_size=0.25, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be added to the docstring!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely.
def _compute_delays(self, X_ww, y, original_features): | ||
"""Computes the delayed features for all features in X and y. | ||
|
||
Use the autocorrelation to determine delays. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess if we're going to keep this docstring, we should update.
max_delay=max_delay, | ||
forecast_horizon=forecast_horizon, | ||
gap=gap, | ||
delay_features=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this just be parameterized into the other test? If you feel it's better tested out explicitly, that's cool too. I assume that's why you did this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I liked testing both halves of the feature engineering computation separately to make it easier to verify the output matched the expected value!
}, | ||
index=pd.RangeIndex(50, 81), | ||
) | ||
rolling_features_target_only = pd.DataFrame( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rolling_features_target_only = rolling_features
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I like the tests you added, and the perf test results look good! Exciting to get this in!
@@ -59,6 +66,7 @@ def __init__( | |||
gap=0, | |||
forecast_horizon=1, | |||
conf_level=0.05, | |||
rolling_window_size=0.25, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add to docstring
Pull Request Description
Fixes #2510
Perf tests here
After creating the pull request: in order to pass the release_notes_updated check you will need to update the "Future Release" section of
docs/source/release_notes.rst
to include this pull request by adding :pr:123
.