MetricsWeighted (version 0.3.0)

deviance_bernoulli: Bernoulli Deviance

Description

Calculates weighted average of unit Bernoulli deviance. Defined as twice logLoss. The smaller the deviance, the better.

Usage

deviance_bernoulli(actual, predicted, w = NULL, ...)

Arguments

actual

Observed values (0 or 1).

predicted

Predicted values strictly between 0 and 1.

w

Optional case weights.

...

Further arguments passed to logLoss.

Value

A numeric vector of length one.

See Also

logLoss.

Examples

Run this code
# NOT RUN {
deviance_bernoulli(c(0, 0, 1, 1), c(0.1, 0.1, 0.9, 0.8))
deviance_bernoulli(c(1, 0, 0, 1), c(0.1, 0.1, 0.9, 0.8))
deviance_bernoulli(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 DataCamp Workspace