-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
fix(fbprophet): Fix weekly frequencies #20326
Conversation
Codecov Report
@@ Coverage Diff @@
## master #20326 +/- ##
==========================================
+ Coverage 66.56% 66.92% +0.36%
==========================================
Files 1738 1738
Lines 65025 65597 +572
Branches 6883 6883
==========================================
+ Hits 43281 43902 +621
+ Misses 19994 19945 -49
Partials 1750 1750
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
0592604
to
34043c4
Compare
@zhaoyongjie would you mind reviewing this PR? |
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, thanks for the fix!
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.
Tested in my local, goods great. Thanks for the fix. I believed that the master branch code coverage was 100%, and you can safely merge this.
(cherry picked from commit 8b0bee5)
SUMMARY
The
fbprophet
packages usespandas.date_range
per here for defining the forecast window where the frequency is defined via an offset alias.Previously the mapping was wrong, i.e., these weeks which use different days of the weeks as anchors (alongside the direction of the anchor, i.e., starting vs. ending) previously all mapped to
W
which is the same asW-SUN
and thus weekly forecasts did not adhere to the correct periodicity defined in the fitted data.The fix is merely to use the anchored offsets. Pandas doesn't do a great job in specifying whether it's the week starting or week ending on Sunday say for
W-SUN
, however it's irrelevant for our needs, i.e., for both "Week starting Sunday" and "Week ending Sunday" the data provided by Superset tofbprohet
has been bucketed appropriately and anchored on a Sunday and thus allfbprohet
needs to know is Sundays (W-SUN
) defines the weekly periodicity.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Tested locally and updated unit tests.
ADDITIONAL INFORMATION