-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathticks.qmd
111 lines (82 loc) · 2.52 KB
/
ticks.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
title: "Ticks"
---
```{r, setup, echo = FALSE, message=FALSE, warning=FALSE}
knitr::opts_chunk$set(echo = FALSE, message=FALSE, warning=FALSE)
source("R/plot-utils.R")
score4cast::ignore_sigpipe()
```
```{r}
theme <- "ticks"
cutoff <- as.character(Sys.Date() - 120)
combined <- arrow::open_dataset(glue("cache/parquet/{theme}")) |>
filter(date >= cutoff) |> collect()
#combined |> filter(!is.na(observation))
```
```{r}
#knitr::opts_chunk$set(eval=FALSE) # no tick data
```
## Forecasts
These plots show forecasts that were submitted on `r cutoff` for which we have at least 10 observations.\
Models which did not submit a forecast on the given reference date are not shown.
```{r}
sites <- combined |> distinct(site_id) |> collect() |> pull(site_id)
## with at least n observations to compare!
n_data <- 30
who <- combined |>
# filter(!is.na(observation)) |>
distinct(reference_datetime) |>
arrange(desc(reference_datetime)) |>
collect()
ref <- as.character (who[6,1]) #
```
### *Amblyomma americanum*
::: panel-tabset
```{r}
richness <- combined |>
filter(reference_datetime == ref, variable == "amblyomma_americanum")
```
## Sites 1 - 3
```{r}
richness |> filter(site_id %in% sites[1:3]) |> forecast_plots(ncol=3)
```
## Sites 4 - 6
```{r}
richness |> filter(site_id %in% sites[4:6]) |> forecast_plots(ncol=3)
```
## Sites 7 - 9
```{r}
richness |> filter(site_id %in% sites[7:9]) |> forecast_plots(ncol=3)
```
:::
## Leaderboard
Average skill scores of each model across all sites.\
Scores are shown by reference date and forecast horizon (in days).\
Scores are averaged across all submissions of the model with a given horizon or a given `reference_datetime` out of submissions made since the cutoff date.
::: panel-tabset
## *Amblyomma americanum*
```{r}
leaderboard_plots(combined, "amblyomma_americanum")
```
:::
## Submission statistics
```{r}
n_models <- combined |> distinct(model_id) |> nrow()
n_forecasts <- combined |> distinct(reference_datetime, model_id) |> nrow()
```
Between `r cutoff` and `r Sys.Date()`:
- `r n_models` models have submitted a total of `r n_forecasts` forecasts to this challenge
```{r}
current_day <- Sys.Date()
combined |>
distinct(model_id, reference_datetime) |>
count(model_id, sort=TRUE) |>
filter(n > 1) |>
mutate(model_id = fct_reorder(model_id, n)) |>
ggplot(aes(model_id, n, fill=model_id)) +
geom_col(show.legend = FALSE) +
coord_flip() +
theme_bw() +
theme(axis.text=element_text(size=6)) +
ggtitle(glue("Number of forecast submissions since {cutoff}"))
```