Poisson_LogLoss: Poisson Log loss

Description Usage Arguments Value Examples

View source: R/Count.R

Description

Compute the log loss/cross-entropy loss.

Usage

1
Poisson_LogLoss(y_pred, y_true)

Arguments

y_pred

Predicted labels vector, as returned by a model

y_true

Ground truth (correct) labels vector

Value

Log loss/Cross-Entropy Loss

Examples

1
2
3
4
5
d_AD <- data.frame(treatment = gl(3,3), outcome = gl(3,1,9),
                   counts = c(18,17,15,20,10,20,25,13,12))
glm_poisson <- glm(counts ~ outcome + treatment,
                   family = poisson(link = "log"), data = d_AD)
Poisson_LogLoss(y_pred = glm_poisson$fitted.values, y_true = d_AD$counts)

Example output

Attaching package: 'MLmetrics'

The following object is masked from 'package:base':

    Recall

[1] 2.597851

MLmetrics documentation built on May 30, 2017, 3 a.m.