powered by
Calculates weighted logloss resp. cross entropy. Equals half of the unit Bernoulli deviance. The smaller, the better.
logLoss(actual, predicted, w = NULL, ...)
A numeric vector of length one.
Observed values (0 or 1).
Predicted values strictly larger than 0 and smaller than 1.
Optional case weights.
Further arguments passed to weighted_mean.
weighted_mean
deviance_bernoulli.
deviance_bernoulli
logLoss(c(0, 0, 1, 1), c(0.1, 0.1, 0.9, 0.8)) logLoss(c(0, 0, 1, 1), c(0.1, 0.1, 0.9, 0.8), w = 1:4)
Run the code above in your browser using DataLab