Learn R Programming

MetricsWeighted (version 0.5.4)

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, ...)

Value

A numeric vector of length one.

Arguments

actual

Observed values (0 or 1).

predicted

Predicted values strictly between 0 and 1.

w

Optional case weights.

...

Further arguments passed to logLoss.

See Also

logLoss.

Examples

Run this code
deviance_bernoulli(c(0, 0, 1, 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 DataLab