Skip to content

Commit 71d55e8

Browse files
committed
sorting, us vs usa
1 parent 50ecf7b commit 71d55e8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ parse_prod_weights <- function(filename = here::here("covid_geo_exclusions.csv")
158158
gen_forecast_date) {
159159
all_states <- c(
160160
unique(readr::read_csv("https://raw.githubusercontent.com/cmu-delphi/covidcast-indicators/refs/heads/main/_delphi_utils_python/delphi_utils/data/2020/state_pop.csv", show_col_types = FALSE)$state_id),
161-
"usa"
161+
"usa", "us"
162162
)
163163
all_prod_weights <- readr::read_csv(filename, comment = "#", show_col_types = FALSE)
164164
# if we haven't set specific weights, use the overall defaults

scripts/flu_hosp_prod.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ rlang::list2(
173173
tar_target(
174174
name = ensemble_mixture_res,
175175
command = {
176-
forecast_res %>%
176+
ensembled <-
177+
forecast_res %>%
177178
# Apply the ahead-by-quantile weighting scheme
178179
ensemble_linear_climate(aheads, other_weights = geo_forecasters_weights) %>%
179180
filter(geo_value %nin% geo_exclusions) %>%
@@ -182,6 +183,11 @@ rlang::list2(
182183
bind_rows(forecast_res %>% filter(forecaster == "windowed_seasonal")) %>%
183184
group_by(geo_value, forecast_date, target_end_date, quantile) %>%
184185
summarize(value = mean(value, na.rm = TRUE), .groups = "drop")
186+
#filter(geo_value != "us", geo_value !="usa")
187+
sorted <- ensembled %>%
188+
group_by(geo_value, forecast_date, target_end_date) %>%
189+
mutate(value = sort(value))
190+
sorted
185191
},
186192
),
187193
tar_target(

0 commit comments

Comments
 (0)