@@ -268,15 +268,15 @@ For a more formal comparison between the two approaches, we could compare the te
268
268
269
269
``` {r, message = FALSE}
270
270
baseline_preds_mae_df <- baseline_preds %>%
271
- left_join(tedf_sub, by = c("geo_value", "target_date"))
272
- group_by(ahead) %>%
271
+ left_join(tedf_sub, by = c("geo_value", "target_date")) %>%
272
+ group_by(ahead) %>%
273
273
mutate(error = abs(`0.5` - actual)) %>%
274
274
summarise(mean = mean(error)) %>%
275
275
mutate(type = "baseline")
276
276
277
277
smooth_preds_mae_df <- smooth_preds %>%
278
- left_join(tedf_sub, by = c("geo_value", "target_date"))
279
- group_by(ahead) %>%
278
+ left_join(tedf_sub, by = c("geo_value", "target_date")) %>%
279
+ group_by(ahead) %>%
280
280
mutate(error = abs(`0.5` - actual)) %>%
281
281
summarise(mean = mean(error)) %>%
282
282
mutate(type = "smooth")
@@ -333,15 +333,15 @@ Next, we apply the `wis_dist_quantile` function to get a WIS score for each stat
333
333
334
334
``` {r}
335
335
smooth_preds_wis_df <- smooth_preds %>%
336
- left_join(tedf_sub, by = c("geo_value", "target_date"))
337
- rowwise() %>%
336
+ left_join(tedf_sub, by = c("geo_value", "target_date")) %>%
337
+ rowwise() %>%
338
338
mutate(wis = wis_dist_quantile(actual, c(`0.1`, `0.25`, `0.5`, `0.75`, `0.9`), several_quantiles)) %>%
339
339
group_by(ahead) %>%
340
340
summarise(mean = mean(wis)) %>%
341
341
mutate(type = "smooth")
342
342
343
343
baseline_preds_wis_df <- baseline_preds %>%
344
- left_join(tedf_sub) %>%
344
+ left_join(tedf_sub, by = c("geo_value", "target_date") ) %>%
345
345
rowwise() %>%
346
346
mutate(wis = wis_dist_quantile(actual, c(`0.1`, `0.25`, `0.5`, `0.75`, `0.9`), several_quantiles)) %>%
347
347
group_by(ahead) %>%
0 commit comments