-
Notifications
You must be signed in to change notification settings - Fork 894
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
Feat/specify lags per component for RegressionModel #1962
Conversation
…component-specific lags
…same number of components
Codecov ReportPatch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. 📢 Thoughts on this report? Let us know!. |
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.
Thanks a lot @madtoinou, this looks great 🚀
Only had some suggestions about simplifying the lag handling in the model constructor, and some docs rephrasing here and there.
Co-authored-by: Dennis Bader <[email protected]>
… check and processing of the values
… check and processing of the values
… limit iteration of the series
… tests parametrization
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.
Nice, just a last few suggestions, then we can merge :)
# cannot use 'default_lags' because it's converted in `fit()`, before calling `_created_lagged_data` | ||
model_instance = RegressionModel( | ||
lags={"0-trgt-0": [-4, -3], "0-trgt-1": [-3, -2], "0-trgt-2": [-2, -1]}, | ||
lags_past_covariates={"0-pcov-0": [-10], "0-pvoc-1": [-7]}, |
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.
Shouldn't the second component's name be "0-pcov-1"? Is it a bug that the model doesn't raise an error for a wrong component name?
lags_past_covariates={"0-pcov-0": [-10], "0-pvoc-1": [-7]}, | |
lags_past_covariates={"0-pcov-0": [-10], "0-pcov-1": [-7]}, |
Co-authored-by: Dennis Bader <[email protected]>
…hen using dict to define the lags
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.
Looks great now, thanks a lot @madtoinou 🚀
After we check the issue from our discussion today, we can merge this one
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.
Very nice, thanks a lot @madtoinou, everything looks great now 💯
🚀
Fixes #1110.
Summary
RegressionModel
's constructor acceptsDict[str, Sequence[int]]
for the argumentslags
,lags_past_covariates
andlags_future_covariates
. The keys in the dictionary must correspond to the name of the components of the series used for training (or the first series when using multiple series) as well as the components generated by the encoders (when applicable).lagged_features_name
attribute was updated accordinglyOther Information
_create_lagged_data_by_moving_window
supports extracting the values for each component independently, it's the function used by default inRegressionModel._create_lagged_data
and the user cannot change it from the API.ShapExplainer
is working as intented with component-specific lags.