Skip to content

Commit

Permalink
attempt to modify for 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitejohnson committed Nov 5, 2024
1 parent d511530 commit e137def
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions vignettes/spatial_wwinference.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2393,14 +2393,7 @@ hosp_scores_forecast <- hosp_obj_for_eval_forcast %>%
"date", "model", "gen_model_type"
)
) |>
score(metrics = c(
"log_score",
"crps",
"dss",
"ae_median",
"se_mean",
"bias"
)) %>%
score() %>%
inner_join(
ess_per_sec_df,
by = c("model", "gen_model_type")
Expand Down Expand Up @@ -2463,6 +2456,12 @@ hosp_by_date_eval_forecast_plot <- ggplot( # nolint
xlab("Date") +
theme_bw()
attr(hosp_scores_forecast, "metrics") <- c(
"bias", "dss", "crps", "overprediction",
"underprediction", "dispersion", "log_score",
"mad", "ae_median", "se_mean"
)
hosp_eval_forecast_plot <- ggplot(
hosp_scores_forecast %>%
Expand Down Expand Up @@ -2578,28 +2577,27 @@ hosp_obj_for_eval_nowcast <- all_pred_draws_df %>%
by = c("date", "gen_model_type")
) %>%
mutate(
prediction = pred_value,
predicted = pred_value,
observed = true_value,
sample = draw,
model = inf_model_type
) %>%
select(
prediction,
true_value,
predicted,
observed,
sample,
date,
model,
gen_model_type
)
hosp_scores_nowcast <- hosp_obj_for_eval_nowcast %>%
score(metrics = c(
"log_score",
"crps",
"dss",
"ae_median",
"se_mean",
"bias"
)) %>%
as_forecast_sample(
forecast_unit = c(
"date", "model", "gen_model_type"
)
) %>%
score() %>%
inner_join(
ess_per_sec_df,
by = c("model", "gen_model_type")
Expand Down Expand Up @@ -2662,7 +2660,11 @@ hosp_by_date_eval_nowcast_plot <- ggplot(
xlab("Date") +
theme_bw()
attr(hosp_scores_nowcast, "metrics") <- c(
"bias", "dss", "crps", "overprediction",
"underprediction", "dispersion", "log_score",
"mad", "ae_median", "se_mean"
)
hosp_eval_nowcast_plot <- ggplot(
hosp_scores_nowcast %>%
summarize_scores(by = c("model", "gen_model_type")) %>%
Expand Down

0 comments on commit e137def

Please sign in to comment.