epiforecasts / scoringutils

Utilities for Scoring and Assessing Predictions
https://epiforecasts.io/scoringutils/
Other
48 stars 20 forks source link

We should check for consistency when scoring binary forecasts #763

Open nikosbosse opened 4 months ago

nikosbosse commented 4 months ago

Transforming a vector of 0s and 1s into a factor can be tricky (at least if you're me).

Consider the following example:

set.seed(123)
test <- rbinom(n = 5, size = 1, prob = 0.7)
obs1 <- factor(test, levels = c(1, 0))
obs2 <- factor(test, levels = c(0, 1))

mean(brier_score(obs1, 0.7))
mean(brier_score(obs2, 0.7))

those two things give different results.

I suggest the following:

seabbs commented 4 months ago

yes sounds like a good idea but is this really 2.0 or for a following version (i.e it seems nice to have vs must have)