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
[BUG] fix behaviour of FourierFeatures
with pd.DatetimeIndex
#3606
[BUG] fix behaviour of FourierFeatures
with pd.DatetimeIndex
#3606
Conversation
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.
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.
Based on this fix and on the discussion on #3605, I suggest we add pd.DateTimeIndex
in the enforce_index_type
list
So the real bug was in the enforce index! I've added |
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.
Looking good!
I left a few suggestions in the comments.
Tests pass now! Just parametrise the test and add a Y_datetime. |
@eenticott-shell - In the case where the index is datetime, will the transformed series index maintain the datetime index, or will it change to period? Cause I think the transform method might be changing the index permanently here. Can you quickly check and maybe add it in the test that the index is not changed. Something like: from pandas.testing import assert_index_equal
assert_index_equal(left, right, exact=True) |
…into fourier_with_datetimeindex
Perfect! that should be good to go now. |
@fkiraly - given it's a bug, can we merge this before the release? your call... |
Thanks for your help! I think one of the tests might fail, I am having trouble running pytest locally but I am currently trying to fix! |
Think that should have fixed it |
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.
the failing test is not related to your transformer:
FAILED sktime/transformations/panel/rocket/tests/test_Rocket.py::test_rocket_on_gunpoint - assert 0.9933333333333333 == 1.0
Left some comments for avoiding a potential side effect in the transform index and removing the redundant index copy in fit.
You need to approve and resolve conversations, @ltsaprounis, if that's what you advocate. |
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 good overall, thank you @eenticott-shell ! Have only one question
@ltsaprounis could you please resolve the pending changes if you're satisfied with them? |
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.
Looking good! thanks for the fix and your patience with the change requests @eenticott-shell! Will merge once the tests are done.
Reference Issues/PRs
Fixes #3605
What does this implement/fix? Explain your changes.
Adds an extra case into
FourierFeatures
for dealing with apd.DatetimeIndex
. These are stored in nanoseconds and so the seasonalities have to also be specified in nanoseconds. Wanted to avoid this and work from frequency instead for the DatetimeIndex case.What should a reviewer concentrate their feedback on?
Any other comments?