[ENH] add BaseSeriesTransformer - Moving Average Transformer#1927
Conversation
Thank you for contributing to
|
089bfd3 to
85a8cec
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
3a97747 to
fe85546
Compare
591c16e to
5286720
Compare
MatthewMiddlehurst
left a comment
There was a problem hiding this comment.
Will let @TonyBagnall comment on functionality, but looks fine to me.
5286720 to
bb40942
Compare
…st_moving_average.py
…edundannt input shape X checking
TonyBagnall
left a comment
There was a problem hiding this comment.
LGTM, only thing I can think of is to check that window length is not longer than the series, but not a blocker
Reference Issues/PRs
What does this implement/fix? Explain your changes.
Does your contribution introduce a new dependency? If yes, which one?
Any other comments?
x Basic version is "for loop + window calculation" across the the input array.
x Implemented version: 1) precalculate a cumulative sum 2) vector subtraction + division afterwards
x Pros: Faster than basic version. O(1) vs O(window_size)
x Cons: Requires extra memory to cache the cumulative sum. O(n) vs O(1)