log_loss: Log Loss

Description Usage Arguments Value Examples

View source: R/math_utils.R

Description

An implementation of the Log-Loss function for the binomial case

Usage

1
log_loss(Y, p, eps = 1e-15, verb = TRUE)

Arguments

Y

Response vector of n binary observatios (integers 0,1 - vector of size n) Can be encoded as a factor a numeric vector.

p

Vector of fitted probabilities for each Y.

eps

Machine error to hanlde limit cases on the logarithm function

verb

short for verbose, if TRUE, prints aditional information (logical)

Value

The value of the Log Loss function (numeric). The smaller, the better

Examples

1
2
3
log_loss(true_values, fitted probabilities)
log_loss(true_values, fitted probabilities)
log_loss(true_values, fitted probabilities, 1e-30, FALSE)

PaoloLuciano/BPWPM documentation built on May 21, 2019, 1:20 p.m.