Skip to content

Implement function to grab the most recent data, sufficient for prediction #26

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

Closed
dajmcdon opened this issue May 24, 2022 · 4 comments · Fixed by #32
Closed

Implement function to grab the most recent data, sufficient for prediction #26

dajmcdon opened this issue May 24, 2022 · 4 comments · Fixed by #32
Assignees
Labels
good first issue Good for newcomers

Comments

@dajmcdon
Copy link
Contributor

For example, if we have max_lag = 14, then we would do something like:

x_latest <- x %>%
  filter(!is.na(case_rate), !is.na(death_rate)) %>%
  group_by(geo_value) %>%
  slice_tail(n = 15) # have lag 0,...,14, so need 15 for a complete case

The function should read the epi_recipe, perhaps after prep() or bake().

@dajmcdon dajmcdon added the good first issue Good for newcomers label May 24, 2022
@ChloeYou
Copy link
Contributor

ChloeYou commented May 27, 2022

Hi Daniel! @dajmcdon I was wondering if I can I get some clarifications on this?

Would this function be a separate function stored in the arx_forecaster.R file? Additionally, would this function go somewhere before line 44? or perhaps it should exist in another file?

Thank you in advance!

@ChloeYou
Copy link
Contributor

ChloeYou commented May 30, 2022

new file, new function. get_target()/ get_test_data()
get recipe and get the data, and read the ahead (I think it should read the lag?)

example: look at

step_epi_ahead(death_rate, ahead = 7) %>%

b <- bake(prep(r))

@ChloeYou
Copy link
Contributor

Logan suggested taking a look at the following that included this operation:

cmu-delphi/covidcast/R-packages/modeltools

create_train_and_predict_matrices() although it had issues when dealing with data with nonzero reporting latency

@ChloeYou
Copy link
Contributor

TO-DO: Add unit tests for this new function before creating a PR

kenmawer added a commit that referenced this issue Jun 7, 2022
Removed export of epi_shift and improved test names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants