logs_binary | R Documentation |
Computes the Log Score for probabilistic forecasts of binary outcomes.
logs_binary(true_values, predictions)
true_values |
A vector with the true observed values of size n with all values equal to either 0 or 1 |
predictions |
A vector with a predicted probability that true_value = 1. |
The Log Score is a proper score rule suited to assessing the accuracy of probabilistic binary predictions. The outcomes can be either 0 or 1, the predictions must be a probability that the true outcome will be 1.
The Log Score is then computed as the negative logarithm of the probability assigned to the true outcome. Reporting the negative logarithm means that smaller values are better.
A numeric value with the Log Score, i.e. the mean squared error of the given probability forecasts
true_values <- sample(c(0, 1), size = 30, replace = TRUE) predictions <- runif(n = 30, min = 0, max = 1) logs_binary(true_values, predictions)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.