Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We should check for consistency when scoring binary forecasts #763

Open
nikosbosse opened this issue Mar 30, 2024 · 1 comment
Open

We should check for consistency when scoring binary forecasts #763

nikosbosse opened this issue Mar 30, 2024 · 1 comment

Comments

@nikosbosse
Copy link
Contributor

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:

  • we add some functionality which, at least in the simple case with 0s and 1s, checks whether the levels correspond to the numbers in the input vector. If that's not the case, we throw a warning.
  • we create a helper function that allows users to convert their input into a factor and specify exactly which outcome their predicted value corresponds to.
@seabbs
Copy link
Contributor

seabbs commented Apr 3, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants