Use illustration of local and global scores
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- r
- Domain
- data-visualization, documentation
Research direction
Start by locating the vignette that explains differences between scores and review the supplied R plotting code, including the output path inst/manuscript/output/score-locality.png. Done means the illustration is incorporated into a vignette and clearly explains the differences between local and global scores.
Written by the indexing model from the issue text.
Description
We have this nice illustration:
It's not used in the manuscript anymore. But it would be nice to use it in a vignette explaining differences between scores.
Related: #933, #929, #930
This was the code to generate the plot:
library(scoringutils)
library(ggplot2)
library(data.table)
quantiles <- seq(0.1, 1, 0.1)
forecast_a <- c(0.3, 0.35, 0.25, 0.04, 0.02, 0.01, 0.01, 0.01, 0.005, 0.005)
forecast_b <- c(0.1, 0.35, 0.05, 0.02, 0.01, 0.01, 0.05, 0.07, 0.2, 0.14)
true_value <- 2
df <- data.table(
forecaster = rep(c("Forecaster A", "Forecaster B"), each = 10),
outcome = rep(1:10, 2),
prob = c(forecast_a, forecast_b),
true_value = true_value
)
df[, crps := sum((cumsum(prob) - (outcome >= true_value))^2),
by = c("forecaster")]
df[, log_score := -log(prob[outcome == true_value]),
by = c("forecaster")]
df[, mean_pred := sum(prob * outcome) / sum(prob),
by = c("forecaster")]
df[, sd_pred := sqrt(sum((prob * outcome - mean_pred)^2)),
by = c("forecaster")]
df[, log_score := -log(prob[outcome == true_value]),
by = c("forecaster")]
df[, dss := ((true_value - mean_pred)^2) / sd_pred + 2 * log(sd_pred),
by = c("forecaster")]
# sense-check: compute crps using samples
sample_a <- sample(x=1:10, size = 1e5, replace = TRUE, prob = forecast_a)
sample_b <- sample(x=1:10, size = 1e5, replace = TRUE, prob = forecast_b)
crps_a <- scoringutils::crps_sample(2, t(as.matrix(sample_a)))
crps_b <- scoringutils::crps_sample(2, t(as.matrix(sample_b)))
annotation <- df[, .(forecaster, crps, log_score, dss)] |> unique()
ggplot(df, aes(x = factor(outcome), y = prob)) +
geom_col() +
geom_text(data = annotation, x = 4, y = 0.3, hjust = "left", size = 3,
aes(label = paste("CRPS: ", round(crps, 2)))) +
geom_text(data = annotation,x = 4, y = 0.27, hjust = "left", size = 3,
aes(label = paste("Log score: ", round(log_score, 2)))) +
geom_text(data = annotation, x = 4, y = 0.24, hjust = "left", size = 3,
aes(label = paste("DSS: ", round(dss, 2)))) +
facet_wrap(~ forecaster) +
geom_vline(aes(xintercept = 2), linetype = "dashed") +
theme_scoringutils() +
labs(y = "Probability assigned", x = "Possible outcomes")
ggsave("inst/manuscript/output/score-locality.png", height = 3, width = 8)
- Dominant language
- R
- Stars
- 67
- Forks
- 24
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 2
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from epiforecasts/scoringutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
epiforecasts/scoringutils#1264 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiforecasts/scoringutils#1265 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
epiforecasts/scoringutils#1260 ·
Maintainers usually reply within 1 day
-
Incorrect guidance in `NEWS.md` re `add_relative_skill()`?Possibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1226 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
get_pit_histogram(): unsorted breaks produce negative densities; num_bins = 1 returns an empty tablePossibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1219 ·
Maintainers usually reply within 1 day
All issues in epiforecasts/scoringutils
Similar issues
-
data_bio2rarify - doc - dimensions wrongPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
leppott/BioMonTools#162 ·
-
publications
Difficulty 1/5 Under an hour Newbie friendliness 85/100
epiforecasts/epiforecasts.github.io#161 ·
Maintainers usually reply within 1 day
-
Label `{sas}` chunk source as `sas` instead of `txt`, so it gets syntax highlightingPossibly taken @michaelmayer2 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microbiome/OMA#1031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ThinkR-open/golem#1265 ·