Skip to content

[ENH] add BaseSeriesTransformer - Moving Average Transformer#1927

Merged
TonyBagnall merged 19 commits into
aeon-toolkit:mainfrom
Datadote:base-series-transformer/moving-average
Sep 13, 2024
Merged

[ENH] add BaseSeriesTransformer - Moving Average Transformer#1927
TonyBagnall merged 19 commits into
aeon-toolkit:mainfrom
Datadote:base-series-transformer/moving-average

Conversation

@Datadote
Copy link
Copy Markdown
Contributor

@Datadote Datadote commented Aug 8, 2024

Reference Issues/PRs

What does this implement/fix? Explain your changes.

  • Add smoothing filter MovingAverageTransformer
  • Tests have been added to check calculations with window_size < 0, == 0, > 0

Does your contribution introduce a new dependency? If yes, which one?

  • No new dependencies. Imports libraries: numpy

Any other comments?

  • There are different ways to implement simple moving average.
    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)

@aeon-actions-bot aeon-actions-bot Bot added enhancement New feature, improvement request or other non-bug code enhancement transformations Transformations package labels Aug 8, 2024
@aeon-actions-bot
Copy link
Copy Markdown
Contributor

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: [ $\color{#FEF1BE}{\textsf{enhancement}}$ ].
I have added the following labels to this PR based on the changes made: [ $\color{#41A8F6}{\textsf{transformations}}$ ]. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.

Don't hesitate to ask questions on the aeon Slack channel if you have any.

PR CI actions

These checkboxes will add labels to enable/disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.

  • Run pre-commit checks for all files
  • Run all pytest tests and configurations
  • Run all notebook example tests
  • Run numba-disabled codecov tests
  • Stop automatic pre-commit fixes (always disabled for drafts)
  • Push an empty commit to re-run CI checks

@Datadote Datadote force-pushed the base-series-transformer/moving-average branch from 089bfd3 to 85a8cec Compare August 12, 2024 21:57
Comment thread aeon/transformations/series/_moving_average.py Outdated
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Datadote Datadote force-pushed the base-series-transformer/moving-average branch from 3a97747 to fe85546 Compare August 21, 2024 23:18
@Datadote Datadote marked this pull request as ready for review August 22, 2024 20:47
@Datadote Datadote requested a review from aiwalter as a code owner August 22, 2024 20:47
@Datadote Datadote force-pushed the base-series-transformer/moving-average branch from 591c16e to 5286720 Compare August 30, 2024 00:41
Copy link
Copy Markdown
Member

@MatthewMiddlehurst MatthewMiddlehurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will let @TonyBagnall comment on functionality, but looks fine to me.

Comment thread aeon/transformations/series/_moving_average.py Outdated
Comment thread aeon/transformations/series/_moving_average.py Outdated
@Datadote Datadote force-pushed the base-series-transformer/moving-average branch from 5286720 to bb40942 Compare September 2, 2024 20:52
Comment thread aeon/transformations/series/_moving_average.py Outdated
Copy link
Copy Markdown
Contributor

@TonyBagnall TonyBagnall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only thing I can think of is to check that window length is not longer than the series, but not a blocker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, improvement request or other non-bug code enhancement transformations Transformations package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants