Description Usage Arguments Value Examples
This function computes the Logarithmic Loss (Logloss) provided preds
and labels
, while handling multiclass problems.
1 | df_logloss(preds, labels, eps = 1e-15)
|
preds |
The |
labels |
The |
eps |
The threshold for predictions so you do not have infinite loss issued from an observation. Defaults to |
The Logarithmic Loss.
1 2 3 4 5 6 7 8 9 10 11 | library(data.table)
# Binary classification problem
my_preds <- dnorm(rnorm(n = 9*6*10))
my_labels <- as.numeric(runif(n = 9*6*10) >= 0.5)
df_logloss(my_preds, my_labels)
# Multiclass classification problem
my_preds <- data.table(matrix(dnorm(rnorm(n = 9*6*10)), nrow = 9*10))
my_labels <- rep(c(1, 2, 3, 4, 5, 1, 0, 2, 3), 10)
df_logloss(my_preds, my_labels)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.