Debian Codegraph @

man/logLoss.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/logLoss.R
3 \name{logLoss}
4 \alias{logLoss}
5 \alias{logLoss.default}
6 \alias{logLoss.glm}
7 \alias{logLoss.randomForest}
8 \alias{logLoss.glmerMod}
9 \alias{logLoss.gbm}
10 \alias{logLoss.rpart}
11 \title{Log Loss}
12 \usage{
13 logLoss(...)
14
15 \method{logLoss}{default}(actual, predicted, distribution = "binomial", ...)
16
17 \method{logLoss}{glm}(modelObject, ...)
18
19 \method{logLoss}{randomForest}(modelObject, ...)
20
21 \method{logLoss}{glmerMod}(modelObject, ...)
22
23 \method{logLoss}{gbm}(modelObject, ...)
24
25 \method{logLoss}{rpart}(modelObject, ...)
26 }
27 \arguments{
28 \item{\dots}{additional parameters to be passed the the s3 methods}
29
30 \item{actual}{a binary vector of the labels}
31
32 \item{predicted}{a vector of predicted values}
33
34 \item{distribution}{the distribution of the loss function needed \code{binomial, poisson}}
35
36 \item{modelObject}{the model object. Currently supported \code{glm, randomForest, glmerMod, gbm}}
37 }
38 \description{
39 Calculates the log loss or entropy loss for a binary outcome
40 }
41 \examples{
42 data(testDF)
43 glmModel <- glm(y ~ ., data = testDF, family="binomial")
44 Preds <- predict(glmModel, type = 'response')
45
46 logLoss(testDF$y, Preds)
47 # using s3 method for glm
48 logLoss(glmModel)
49
50 }