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

Implemented max_lag #43

Merged
merged 5 commits into from Jul 12, 2022
Merged

Implemented max_lag #43

merged 5 commits into from Jul 12, 2022

Conversation

BSchilperoort
Copy link
Contributor

@BSchilperoort BSchilperoort commented Jul 12, 2022

  • implement max_lag kwarg
  • allow max_lag that exceeds 365 days, automatically skip anchor years
  • write tests for new functionality

@BSchilperoort BSchilperoort marked this pull request as ready for review July 12, 2022 08:21
@sonarcloud
Copy link

sonarcloud bot commented Jul 12, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@geek-yang geek-yang left a comment

Choose a reason for hiding this comment

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

Nice work! It is nice that by this implementation one can avoid train/test information leakage through skipping years. In the future we would have usecases that allows the overlapping of years (it is described here #44 ). But we can accommodate that easily by providing another key word argument for to enable the option. Well done 😄 !

@@ -7,6 +7,9 @@
from s2spy.time import AdventCalendar


# pylint: disable=protected-access
Copy link
Member

Choose a reason for hiding this comment

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

This is really nice!

Comment on lines +111 to +113
self._n_intervals = max_lag + self._n_target
self._skip_years = np.ceil(self._n_intervals /
periods_per_year).astype(int) - 1
Copy link
Member

Choose a reason for hiding this comment

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

Nice design! In this way we avoid train/test information leakage elegantly.

@BSchilperoort BSchilperoort merged commit 710ade1 into main Jul 12, 2022
@BSchilperoort BSchilperoort deleted the max_lag branch July 12, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants