-
Notifications
You must be signed in to change notification settings - Fork 881
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
Feature/diff #1380
Feature/diff #1380
Conversation
…hods of `BaseDataTransformer` class
…repend` method tests
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.
This looks really good to me, many thanks @mabilton ! I especially like the good tests and docstring :)
There's a small issue with more_itertools
(could we do without?) which prevent the tests from executing. After that, if tests pass, we can merge it soon IMO.
hello, from my side I just spotted some little typos |
…alues()` Co-authored-by: eliane-maalouf <112691612+eliane-maalouf@users.noreply.github.com> Co-authored-by: Julien Herzen <j.herzen@gmail.com>
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.
Many thanks @mabilton ! This will go in the next release :)
Thanks for the help @hrzn , @eliane-maalouf ! |
Codecov ReportBase: 93.94% // Head: 94.01% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1380 +/- ##
==========================================
+ Coverage 93.94% 94.01% +0.06%
==========================================
Files 80 81 +1
Lines 8708 8786 +78
==========================================
+ Hits 8181 8260 +79
+ Misses 527 526 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
#641 - Implements
Diff
data transformer which can difference and 'undifference' time series.Summary
Diff
sequentially applies a series oflags
parameter; for example, settinglags = [1, 12]
first applies 1-lagged differencing to the time series, and then 12-lagged differencing to the 1-lagged differenced series. This interface is essential identical to what's found insktime
.A simple example:
which produces:
Diff
can also be used to 'undifference' data that extends beyond dates it was trained on; such use cases arise when one wants to convert a forecast of a differenced time series back into an undifferenced one. Here's a simple example to illustrate this:Other Information
I also made a few other minor changes while implementing
Diff
:flatten
flag to_reshape_in
and_reshape_out
methods ofBaseDataTransformer
, which specifies whether the last two axes of aseries
should be flattened into one. Whenflatten=False
, these methods essentially mask and unmask the relevantcomponent
s ofseries
usingcomponent_mask
.prepend
andprepend_values
methods (+ tests) toTimeSeries
class - these are essentially the 'opposites' to theappend
andappend_values
methods (i.e. they add new values to the start of a series rather than to the end).append_values
method ofTimeSeries
.As an aside, I'm also planning on implementing an invertible
Deseason
transformer (#638). Before doing so, however, I'd first like to 'clean up' some of the short-comings I personally see with the currentDataTransformer
interface; when I have time, I'll open an issue about this and link that to this PR.Any feedback on what I've done here would be very welcome.
Cheers,
Matt.