Skip to content

Commit 0a406b7

Browse files
committed
a
1 parent 4680e05 commit 0a406b7

File tree

5 files changed

+11
-24
lines changed

5 files changed

+11
-24
lines changed

R/forecasters/forecaster_scaled_pop.R

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,6 @@ scaled_pop <- function(epi_data,
156156
if (adding_source) {
157157
pred_final %<>% select(-source)
158158
}
159-
browser()
160-
res %>%
161-
group_by(geo_value, forecast_date, target_end_date) %>%
162-
summarize(increasing = all(hhs - shift(hhs, 1, -Inf) > 0)) %>%
163-
ungroup() %>%
164-
filter(!increasing)
165-
166-
res %>%
167-
filter(geo_value == "ma", forecast_date == "2023-10-18", target_end_date == "2023-10-18")
168159
gc()
169160
return(pred_final)
170161
}

scripts/covid_hosp_explore.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!exists("ref_time_values_")) {
1010
end_date <- as.Date("2024-04-24")
1111
# end_date <- start_date + 7 * 10
1212
date_step <- 7L
13-
ref_time_values_ <- seq.Date(start_date, end_date, by = 7L)[3]
13+
ref_time_values_ <- seq.Date(start_date, end_date, by = 7L)
1414
}
1515
time_value_adjust <- 3 # this moves the week marker from Saturday to Wednesday
1616

scripts/flu_hosp_prod.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ rlang::list2(
397397
tar_target(
398398
name = truth_data,
399399
command = {
400-
browser()
401400
date <- forecast_generation_date_int
402401
nssp_state <-
403402
current_nssp_archive %>%

scripts/reports/comparison-notebook.Rmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "`r params$forecaster_family`: evaluation on 2023/24 in 2024/25"
2+
title: "`r params$forecaster_family`: evaluation on 2023/24 in 2024/25"
33
date: "compiled on `r format(Sys.time(), '%d %B %Y')`"
44
output:
55
html_document:
@@ -116,12 +116,12 @@ param_table <- params$forecaster_parameters %>%
116116
geomean_ae = round(GeoMean(ae), 2),
117117
mean_wis = round(Mean(wis), 2),
118118
geomean_wis = round(GeoMean(wis), 2),
119-
mean_coverage_80 = round(Mean(coverage_80), 2),
119+
mean_coverage_90 = round(Mean(coverage_90), 2),
120120
) %>%
121121
rename(id = forecaster)
122122
) %>%
123123
arrange(mean_ae) %>%
124-
relocate(id, mean_ae, geomean_ae, mean_wis, geomean_wis, mean_coverage_80)
124+
relocate(id, mean_ae, geomean_ae, mean_wis, geomean_wis, mean_coverage_90)
125125
datatable(param_table)
126126
```
127127

@@ -499,10 +499,10 @@ ggplotly(p, tooltip = "text", height = 800, width = 1000) %>%
499499
layout(hoverlabel = list(bgcolor = "white"))
500500
```
501501

502-
#### % Coverage by Forecast Date
502+
#### 90% Coverage by Forecast Date
503503

504504
```{r}
505-
var <- "coverage_80"
505+
var <- "coverage_90"
506506
group_cols <- c("forecaster", "forecast_date", "ahead")
507507
508508
# Aggregate metric across groups
@@ -539,16 +539,16 @@ p <- ggplot(
539539
facet_wrap(~ahead, nrow = 4, labeller = labeller(ahead = facets.label)) +
540540
scale_color_discrete() +
541541
guides(color = guide_legend(ncol = 2)) +
542-
labs(title = subtitle, x = "Forecast Dates", y = "Arithmetic Mean 80% Coverage")
542+
labs(title = subtitle, x = "Forecast Dates", y = "Arithmetic Mean 90% Coverage")
543543
544544
ggplotly(p, tooltip = "text", height = 800, width = 1000) %>%
545545
layout(hoverlabel = list(bgcolor = "white"))
546546
```
547547

548-
#### % Coverage by Ahead
548+
#### 90% Coverage by Ahead
549549

550550
```{r}
551-
var <- "coverage_80"
551+
var <- "coverage_90"
552552
id_cols <- c("forecaster", "ahead")
553553
554554
# Aggregate metric across groups
@@ -582,15 +582,15 @@ p <- ggplot(
582582
geom_hline(yintercept = .8, linetype = 1, color = "black") +
583583
scale_color_discrete() +
584584
guides(color = guide_legend(ncol = 2)) +
585-
labs(title = subtitle, x = "Days ahead", y = "Arithmetic Mean 80% Coverage")
585+
labs(title = subtitle, x = "Days ahead", y = "Arithmetic Mean 90% Coverage")
586586
587587
ggplotly(p, tooltip = "text", height = 800, width = 1000) %>%
588588
layout(hoverlabel = list(bgcolor = "white"))
589589
```
590590

591591
### Fan plots {.tabset}
592592

593-
Fan plots showing the 80% prediction intervals for the forecasts made by the CMU forecasters and the outside forecasters. The black line is the truth data.
593+
Fan plots showing the 90% prediction intervals for the forecasts made by the CMU forecasters and the outside forecasters. The black line is the truth data.
594594

595595
```{r}
596596
if (params$disease == "flu") {

scripts/targets-exploration-common.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ make_forecasts_and_scores <- function() {
154154
tar_target(
155155
name = forecast,
156156
command = {
157-
debugonce(scaled_pop)
158-
debugonce(slide_forecaster)
159-
browser()
160157
slid <- slide_forecaster(
161158
epi_archive = joined_archive_data,
162159
outcome = "hhs",

0 commit comments

Comments
 (0)