-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbeetles.qmd
176 lines (128 loc) · 3.51 KB
/
beetles.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
title: "Beetles"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message=FALSE, warning=FALSE)
source("R/plot-utils.R")
score4cast::ignore_sigpipe()
```
```{r}
theme <- "beetles"
cutoff <- as.character(Sys.Date() - 120)
combined <- arrow::open_dataset(glue("cache/parquet/{theme}")) |>
filter(date >= cutoff) |> collect()
```
## 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[1,"reference_datetime"]) #
```
### richness
::: panel-tabset
```{r}
richness <- combined |>
filter(reference_datetime == ref, variable == "richness")
```
## Sites 1 - 8
```{r}
richness |> filter(site_id %in% sites[1:8]) |> forecast_plots(ncol=4)
```
## Sites 9 - 16
```{r}
richness |> filter(site_id %in% sites[9:16]) |> forecast_plots(ncol=4)
```
## Sites 17 - 24
```{r}
richness |> filter(site_id %in% sites[17:24]) |> forecast_plots(ncol=4)
```
## Sites 25 - 32
```{r}
richness |> filter(site_id %in% sites[25:32]) |> forecast_plots(ncol=4)
```
## Sites 33 - 40
```{r}
richness |> filter(site_id %in% sites[33:40]) |> forecast_plots(ncol=4)
```
## Sites 41 - 47
```{r}
richness |> filter(site_id %in% sites[41:47]) |> forecast_plots(ncol=4)
```
:::
### abundance
::: panel-tabset
```{r}
abundance <- combined |>
filter(reference_datetime == ref, variable == "abundance")
```
## Sites 1 - 8
```{r}
abundance |> filter(site_id %in% sites[1:8]) |> forecast_plots(ncol=4)
```
## Sites 9 - 16
```{r}
abundance |> filter(site_id %in% sites[9:16]) |> forecast_plots(ncol=4)
```
## Sites 17 - 24
```{r}
abundance |> filter(site_id %in% sites[17:24]) |> forecast_plots(ncol=4)
```
## Sites 25 - 32
```{r}
abundance |> filter(site_id %in% sites[25:32]) |> forecast_plots(ncol=4)
```
## Sites 33 - 40
```{r}
abundance |> filter(site_id %in% sites[33:40]) |> forecast_plots(ncol=4)
```
## Sites 41 - 47
```{r}
abundance |> filter(site_id %in% sites[41:47]) |> forecast_plots(ncol=4)
```
:::
## 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
## richness
```{r}
leaderboard_plots(combined, "richness", horizon_cutoff=100)
```
## abundance
```{r}
leaderboard_plots(combined, "abundance", horizon_cutoff=100)
```
:::
## 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}"))
```