Skip to content
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

Feat/MIDAS transformer #1820

Merged
merged 73 commits into from
Nov 18, 2023
Merged

Feat/MIDAS transformer #1820

merged 73 commits into from
Nov 18, 2023

Conversation

madtoinou
Copy link
Collaborator

Fixes #1570.

Summary

Based on @Beerstabr PR #1668, simplified some part of the code and made the transformer invertible.

The original high frequency is imputed based on the number of component introduced by the transform() method and the low frequency name (which is used to generate a pd.Timedelta). We could also allow the user to hint the target frequency by adding an argument to the function.

When the ratio between the low and the high frequency is not a fixed number (number of days in a quarter for example, after doing from months to quarter), the code relies on a rule-based logic. For anchored offset (W-SUN for example), the start time of the returned TimeSeries is not always identical to the original TimeSeries so I added an offset argument to allow the user to adjust for it

Other Information

Not sure if the strip parameter should be set to True by default or even part of the transform as it can induce counter-intuitive results. @Beerstabr, did you include it for any specific reason?

Beerstabr and others added 22 commits February 27, 2023 21:23
…like they should in case of a MIDAS transformation.
…for every quarter instead of there being some missing months, also changed the docstring a bit such that it works with the debugger
@Beerstabr
Copy link
Contributor

@madtoinou I just included the strip argument for convenience, however it indeed can lead to unexpected behaviour. More fool-proof to remove that argument, agreed!

Thank you very mich for finishing this job and doing at such an impressive pace!

@madtoinou madtoinou added this to In review in darts via automation Jun 8, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (36a1c09) 93.85% compared to head (bb4a330) 93.90%.

Files Patch % Lines
darts/dataprocessing/transformers/midas.py 98.12% 3 Missing ⚠️
darts/timeseries.py 94.73% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1820      +/-   ##
==========================================
+ Coverage   93.85%   93.90%   +0.05%     
==========================================
  Files         134      135       +1     
  Lines       13123    13283     +160     
==========================================
+ Hits        12317    12474     +157     
- Misses        806      809       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@dennisbader dennisbader left a comment

Choose a reason for hiding this comment

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

I made some updates:

  • probabilistic supports
  • leverage sliding windows for MIDAS.transform() instead of iterating through the dataframe
  • reduce upsampling to a minumum

Thanks again and congrats for this @Beerstabr and @madtoinou!
It was a long way, but now it's ready to be merged :) 💯 🚀

@dennisbader dennisbader merged commit d153c95 into master Nov 18, 2023
9 checks passed
darts automation moved this from In review to Done Nov 18, 2023
@dennisbader dennisbader deleted the feat/add_midas_transformer branch November 18, 2023 15:21
@dennisbader dennisbader moved this from Done to Released in darts Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
darts
Released
Development

Successfully merging this pull request may close these issues.

Add transformer that converts higher frequency time series to lower frequency
4 participants