This function computes the Logarithmic loss without shrinking predictions (you may encounter infinite predictions).
metrics.logloss.unsafe(preds, labels, eps = 1e-15)
preds | Type: numeric. The predictions. |
---|---|
labels | Type: numeric. The labels (0, 1). |
eps | Type: numeric. The shrinkage between the 0 and 1's bounds. |
The Logarithmic loss.
set.seed(11111) metrics.logloss.unsafe(preds = runif(10000, 0, 1), labels = round(runif(10000, 1)))#> [1] 0.9969976