Skip to content

Commit 2dad893

Browse files
committed
Merge branch 'fix' into evaluate_current_season
2 parents 4957ccc + 0a406b7 commit 2dad893

File tree

11 files changed

+296
-341
lines changed

11 files changed

+296
-341
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ reports/*.html
1717
reports/report.md
1818
cache/
1919
data/
20-
.vscode/
20+
.vscode/

Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,38 @@ prod: prod-covid prod-flu update_site netlify
2424

2525
submit-covid:
2626
cd ../covid19-forecast-hub; \
27-
git pull delphi main; \
27+
git pull origin main; \
2828
git add model-output/CMU-TimeSeries/*; \
29+
git add model-output/CMU-climate_baseline/*; \
2930
git commit -am "CMU-Delphi submission $(current_date)"; \
3031
git push delphi main; \
3132
gh pr create --title "CMU-TimeSeries $(current_date)" --repo cdcgov/covid19-forecast-hub
3233

3334
submit-flu:
3435
cd ../FluSight-forecast-hub; \
35-
git pull delphi main; \
36+
git pull origin main; \
3637
git add model-output/CMU-TimeSeries/*; \
38+
git add model-output/CMU-climate_baseline/*; \
3739
git commit -am "CMU-Delphi submission $(current_date)"; \
38-
git push delphi; \
40+
git push delphi main; \
3941
gh pr create --title "CMU-TimeSeries $(current_date)" --repo cdcepi/FluSight-forecast-hub
4042

4143
submit-covid-dry:
4244
cd ../covid19-forecast-hub; \
43-
git pull delphi main; \
45+
git pull origin main; \
4446
git add model-output/CMU-TimeSeries/*; \
47+
git add model-output/CMU-climate_baseline/*; \
4548
git commit -am "CMU-Delphi submission $(current_date)"; \
4649
git push delphi main; \
4750
gh pr create --title "CMU-TimeSeries $(current_date)" --repo cdcgov/covid19-forecast-hub --dry-run
4851

4952
submit-flu-dry:
5053
cd ../FluSight-forecast-hub; \
51-
git pull delphi main; \
54+
git pull origin main; \
5255
git add model-output/CMU-TimeSeries/*; \
56+
git add model-output/CMU-climate_baseline/*; \
5357
git commit -am "CMU-Delphi submission $(current_date)"; \
54-
git push delphi; \
58+
git push delphi main; \
5559
gh pr create --title "CMU-TimeSeries $(current_date)" --repo cdcepi/FluSight-forecast-hub --dry-run
5660

5761
submit: submit-covid submit-flu

R/aux_data_utils.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,8 @@ get_health_data <- function(as_of, disease = c("covid", "flu")) {
326326

327327
most_recent_row <- meta_data %>%
328328
# update_date is actually a time, so we need to filter for the day after.
329-
filter(update_date <= as_of + 1) %>%
330-
arrange(desc(update_date)) %>%
331-
slice(1)
329+
filter(update_date <= as.Date(as_of) + 1) %>%
330+
slice_max(update_date)
332331

333332
if (nrow(most_recent_row) == 0) {
334333
cli::cli_abort("No data available for the given date.")
@@ -344,9 +343,7 @@ get_health_data <- function(as_of, disease = c("covid", "flu")) {
344343
if (disease == "covid") {
345344
data %<>% mutate(
346345
hhs = previous_day_admission_adult_covid_confirmed +
347-
previous_day_admission_adult_covid_suspected +
348-
previous_day_admission_pediatric_covid_confirmed +
349-
previous_day_admission_pediatric_covid_suspected
346+
previous_day_admission_pediatric_covid_confirmed
350347
)
351348
} else if (disease == "flu") {
352349
data %<>% mutate(hhs = previous_day_admission_influenza_confirmed)

R/forecasters/epipredict_utilities.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ run_workflow_and_format <- function(preproc,
130130
# keeping only the last time_value for any given location/key
131131
pred %<>%
132132
group_by(across(all_of(key_colnames(train_data, exclude = "time_value")))) %>%
133-
# TODO: slice_max(time_value)?
134-
arrange(time_value) %>%
135-
filter(row_number() == n()) %>%
133+
slice_max(time_value) %>%
136134
ungroup()
137135
return(format_storage(pred, as_of))
138136
}

R/forecasters/forecaster_scaled_pop.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ scaled_pop <- function(epi_data,
142142
)
143143
}
144144

145-
df <- preproc %>%
146-
prep(epi_data) %>%
147-
bake(epi_data)
148-
write_rds(df, "df2.rds")
149-
150-
df1 <- read_rds("df1.rds")
151-
df2 <- read_rds("df2.rds")
152-
153145
# with all the setup done, we execute and format
154146
pred <- run_workflow_and_format(preproc, postproc, trainer, season_data, epi_data)
155147
# now pred has the columns

R/scoring.R

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,6 @@ evaluate_predictions <- function(forecasts, truth_data) {
1212
must.include = c("geo_value", "target_end_date", "true_value")
1313
)
1414

15-
browser()
16-
joined_forecasts <- left_join(forecasts, truth_data, by = c("geo_value", "target_end_date"))
17-
18-
joined_forecasts %>%
19-
group_by(model, geo_value, forecast_date, target_end_date) %>%
20-
summarize(increasing = all(prediction - shift(prediction, 1, 0) > 0)) %>%
21-
ungroup() %>%
22-
filter(!increasing)
23-
24-
joined_forecasts %>%
25-
filter(geo_value == "ma", forecast_date == "2023-10-21", target_end_date == "2023-10-21")
26-
27-
# pred_final %>%
28-
# group_by(geo_value, forecast_date, target_end_date) %>%
29-
# summarize(increasing = all(value - shift(value, 1, 0) > 0)) %>%
30-
# ungroup() %>%
31-
# filter(!increasing)
32-
33-
# joined_forecasts %>% filter(geo_value == "ma", forecast_date == "2023-10-07", target_end_date == "2023-10-21") %>% print(n=50)
34-
3515
forecast_obj <- left_join(forecasts, truth_data, by = c("geo_value", "target_end_date")) %>%
3616
scoringutils::as_forecast_quantile(
3717
quantile_level = "quantile",

covid_geo_exclusions.csv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ forecast_date,forecaster,geo_value,weight
88
"2024-10-01", "climate_base", "all", 2
99
"2024-10-01", "climate_geo_agged", "all", 0.5
1010
"2024-10-01", "climate_quantile_extrapolated", "all", 0
11+
# feb 5
12+
2025-02-05, all, mp, 0
13+
2025-02-05, windowed_seasonal, all, 3
14+
2025-02-05, windowed_seasonal_extra_sources, all, 3
15+
2025-02-05, linear, all, 0.5
16+
2025-02-05, linearlog, all, 0
17+
2025-02-05, climate_base, all, 0
18+
2025-02-05, climate_geo_agged, all, 0.0
1119
# dec 4th
1220
"2024-12-04", "all", "mp", 0
1321
"2024-12-04", "linear", "all", 3

flu_geo_exclusions.csv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ forecast_date,forecaster,geo_value,weight
77
2024-10-01, climate_base, all, 0.5
88
2024-10-01, climate_geo_agged, all, 0.25
99
2024-10-01, climate_quantile_extrapolated, all, 0
10+
# feb 5
11+
2025-02-05, all, mp, 0
12+
2025-02-05, windowed_seasonal, all, 3
13+
2025-02-05, windowed_seasonal_extra_sources, all, 3
14+
2025-02-05, linear, all, 0.5
15+
2025-02-05, linearlog, all, 0
16+
2025-02-05, climate_base, all, 0
17+
2025-02-05, climate_geo_agged, all, 0.0
1018
# jan 8
1119
2025-01-08, all, mp, 0
1220
2025-01-08, windowed_seasonal, all, 3

scripts/covid_hosp_explore.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ fetch_args <- epidatr::fetch_args_list(return_empty = FALSE, timeout_seconds = 4
1919
# with prototyping the pipeline.
2020
dummy_mode <- as.logical(Sys.getenv("DUMMY_MODE", FALSE))
2121
# For testing, reduce dates
22-
forecast_generation_dates <- forecast_generation_dates[3]
23-
forecast_dates <- forecast_dates[3]
22+
forecast_generation_dates <- forecast_generation_dates[1:10]
23+
forecast_dates <- forecast_dates[1:10]
2424

2525

2626
# ================================ FORECASTER PARAMETERS ====================

0 commit comments

Comments
 (0)