@@ -9,7 +9,8 @@ truth_data_date <- "2023-09-01"
99# needed to create the aux data targets
1010end_date <- Sys.Date()
1111# Generically set the generation date to the next Wednesday (or today if it's Wednesday)
12- forecast_generation_date <- seq.Date(as.Date(" 2024-11-20" ), Sys.Date(), by = 7L )
12+ forecast_generation_date <- Sys.Date() - 1
13+
1314very_latent_locations <- list (list (
1415 c(" source" ),
1516 c(" flusurv" , " ILI+" )
@@ -98,22 +99,22 @@ rlang::list2(
9899 },
99100 cue = tar_cue(mode = " always" )
100101 ),
101- tar_target(
102- name = nhsn_archive_data ,
103- command = {
104- qs :: qread(here :: here(" cache/nhsn_archive.parquet" )) %> %
105- add_season_info() %> %
106- mutate(
107- source = " nhsn" ,
108- geo_value = ifelse(geo_value == " usa" , " us" , geo_value ),
109- value = nhsn_flu ,
110- time_value = time_value - 3
111- ) %> %
112- select(geo_value , time_value , version , value , epiweek , epiyear , season , season_week , source ) %> %
113- drop_na() %> %
114- as_epi_archive(other_keys = " source" , compactify = TRUE )
115- }
116- ),
102+ # tar_target(
103+ # name = nhsn_archive_data,
104+ # command = {
105+ # qs::qread(here::here("cache/nhsn_archive.parquet")) %>%
106+ # add_season_info() %>%
107+ # mutate(
108+ # source = "nhsn",
109+ # geo_value = ifelse(geo_value == "usa", "us", geo_value),
110+ # value = nhsn_flu,
111+ # time_value = time_value - 3
112+ # ) %>%
113+ # select(geo_value, time_value, version, value, epiweek, epiyear, season, season_week, source) %>%
114+ # drop_na() %>%
115+ # as_epi_archive(other_keys = "source", compactify = TRUE)
116+ # }
117+ # ),
117118 tar_map(
118119 values = tidyr :: expand_grid(tibble(forecast_generation_date = forecast_generation_date )),
119120 names = " forecast_generation_date" ,
@@ -139,7 +140,7 @@ rlang::list2(
139140 command = {
140141 forecast_date <- as.Date(forecast_generation_date )
141142 if (forecast_date < Sys.Date()) {
142- train_data <- nhsn_archive_data %> % epix_as_of(forecast_date )
143+ # train_data <- nhsn_archive_data %>% epix_as_of(forecast_date)
143144 } else {
144145 train_data <- nhsn_latest_data
145146 }
@@ -195,23 +196,23 @@ rlang::list2(
195196 },
196197 cue = tar_cue(mode = " always" )
197198 ),
198- tar_target(
199- name = make_climate_submission_csv ,
200- command = {
201- forecasts <- forecast_res
202- forecasts %> %
203- filter(forecaster %in% c(" climate_base" , " climate_geo_agged" )) %> %
204- group_by(geo_value , target_end_date , quantile ) %> %
205- summarize(forecast_date = first(forecast_date ), value = mean(value , na.rm = TRUE ), .groups = " drop" ) %> %
206- ungroup() %> %
207- format_flusight(disease = " flu" ) %> %
208- write_submission_file(
209- get_forecast_reference_date(as.Date(forecast_generation_date )),
210- file.path(submission_directory , " model-output/CMU-climatological-baseline" )
211- )
212- },
213- cue = tar_cue(mode = " always" )
214- ),
199+ # tar_target(
200+ # name = make_climate_submission_csv,
201+ # command = {
202+ # forecasts <- forecast_res
203+ # forecasts %>%
204+ # filter(forecaster %in% c("climate_base", "climate_geo_agged")) %>%
205+ # group_by(geo_value, target_end_date, quantile) %>%
206+ # summarize(forecast_date = first(forecast_date), value = mean(value, na.rm = TRUE), .groups = "drop") %>%
207+ # ungroup() %>%
208+ # format_flusight(disease = "flu") %>%
209+ # write_submission_file(
210+ # get_forecast_reference_date(as.Date(forecast_generation_date)),
211+ # file.path(submission_directory, "model-output/CMU-climatological-baseline")
212+ # )
213+ # },
214+ # cue = tar_cue(mode = "always")
215+ # ),
215216 tar_target(
216217 name = validate_result ,
217218 command = {
@@ -229,23 +230,23 @@ rlang::list2(
229230 },
230231 cue = tar_cue(mode = " always" )
231232 ),
232- tar_target(
233- name = validate_climate_result ,
234- command = {
235- make_climate_submission_csv
236- # only validate if we're saving the result to a hub
237- if (submission_directory != " cache" ) {
238- validation <- validate_submission(
239- submission_directory ,
240- file_path = sprintf(" CMU-climatological-baseline/%s-CMU-climatological-baseline.csv" , get_forecast_reference_date(as.Date(forecast_generation_date )))
241- )
242- } else {
243- validation <- " not validating when there is no hub (set submission_directory)"
244- }
245- validation
246- },
247- cue = tar_cue(mode = " always" )
248- ),
233+ # tar_target(
234+ # name = validate_climate_result,
235+ # command = {
236+ # make_climate_submission_csv
237+ # # only validate if we're saving the result to a hub
238+ # if (submission_directory != "cache") {
239+ # validation <- validate_submission(
240+ # submission_directory,
241+ # file_path = sprintf("CMU-climatological-baseline/%s-CMU-climatological-baseline.csv", get_forecast_reference_date(as.Date(forecast_generation_date)))
242+ # )
243+ # } else {
244+ # validation <- "not validating when there is no hub (set submission_directory)"
245+ # }
246+ # validation
247+ # },
248+ # cue = tar_cue(mode = "always")
249+ # ),
249250 tar_target(
250251 name = truth_data ,
251252 command = {
0 commit comments