11# The COVID Hospitalization Production Forecasting Pipeline.
22source(" scripts/targets-common.R" )
33
4+ submit_climatological <- FALSE
45submission_directory <- Sys.getenv(" COVID_SUBMISSION_DIRECTORY" , " cache" )
56insufficient_data_geos <- c(" as" , " mp" , " vi" , " gu" )
67# date to cut the truth data off at, so we don't have too much of the past
@@ -143,18 +144,20 @@ rlang::list2(
143144 tar_target(
144145 name = make_climate_submission_csv ,
145146 command = {
146- forecasts <- forecast_res
147- forecasts %> %
148- filter(forecaster %in% c(" climate_base" , " climate_geo_agged" )) %> %
149- group_by(geo_value , target_end_date , quantile ) %> %
150- summarize(forecast_date = first(forecast_date ), value = mean(value , na.rm = TRUE ), .groups = " drop" ) %> %
151- ungroup() %> %
152- format_flusight(disease = " covid" ) %> %
153- write_submission_file(
154- get_forecast_reference_date(as.Date(forecast_generation_date )),
155- submission_directory = file.path(submission_directory , " model-output/CMU-climatological-baseline" ),
156- file_name = " CMU-climatological-baseline"
157- )
147+ if (submit_climatological ) {
148+ forecasts <- forecast_res
149+ forecasts %> %
150+ filter(forecaster %in% c(" climate_base" , " climate_geo_agged" )) %> %
151+ group_by(geo_value , target_end_date , quantile ) %> %
152+ summarize(forecast_date = first(forecast_date ), value = mean(value , na.rm = TRUE ), .groups = " drop" ) %> %
153+ ungroup() %> %
154+ format_flusight(disease = " covid" ) %> %
155+ write_submission_file(
156+ get_forecast_reference_date(as.Date(forecast_generation_date )),
157+ submission_directory = file.path(submission_directory , " model-output/CMU-climatological-baseline" ),
158+ file_name = " CMU-climatological-baseline"
159+ )
160+ }
158161 },
159162 cue = tar_cue(mode = " always" )
160163 ),
@@ -180,7 +183,7 @@ rlang::list2(
180183 command = {
181184 make_climate_submission_csv
182185 # only validate if we're saving the result to a hub
183- if (submission_directory != " cache" ) {
186+ if (submission_directory != " cache" && submit_climatological ) {
184187 validation <- validate_submission(
185188 submission_directory ,
186189 file_path = sprintf(" CMU-climatological-baseline/%s-CMU-climatological-baseline.csv" , get_forecast_reference_date(as.Date(forecast_generation_date )))
0 commit comments