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

Exclude specified dates from selection #14

Open
sdl1 opened this issue May 20, 2021 · 0 comments
Open

Exclude specified dates from selection #14

sdl1 opened this issue May 20, 2021 · 0 comments

Comments

@sdl1
Copy link
Member

sdl1 commented May 20, 2021

We might want to exclude certain dates from our datasets. Something like:

date_range = Date(2018, 1, 1):Day(1):Date(2020, 1, 1)

# Normal date selection
selector = RandomSelector(42, 0.10, Day(3))
validation, holdout = partition(date_range, selector)

# But we don't want these dates
bad_dates =[Date(2019, 1, 1), Date(2019, 12, 1)]

# Do selection as usual, just don't return any of the bad dates
selector_exc = DateExclusionSelector(selector, bad_dates)
validation_exc, holdout_exc = partition(date_range, selector_exc)

# The following should hold:
@assert validation_exc == setdiff(validation, bad_dates)
@assert holdout_exc == setdiff(holdout, bad_dates)
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

No branches or pull requests

1 participant