mlogloss: computes log loss for multiclass problem

Description Usage Arguments Author(s) Examples

Description

computes log loss for multiclass problem

Usage

1
mlogloss(actual, pred_m, eps = 0.001)

Arguments

actual

integer vector with truth labels, values range from 0 to n - 1 classes

pred_m

predicted probs: column 1 => label 0, column 2 => label 1 and so on

eps

numerical cutoff taken very high

Author(s)

Markus Loecher <Markus.Loecher@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# require(nnet)


# set.seed(1)


# actual = as.integer(iris$Species) - 1


# fit = nnet(Species ~ ., data = iris, size = 2)


# pred = predict(fit, iris)#note this is a 3-column prediction matrix!


# 


# mlogloss(actual, pred) # 0.03967





#library(titanic)


#baseline prediction


#data(titanic_train, package="titanic")


yHat = mean(titanic_train$Survived)#0.383838


mlogloss(titanic_train$Survived,yHat)


#try factors


titanic_train$Survived = as.factor(titanic_train$Survived)


mlogloss(titanic_train$Survived,yHat)

markusloecher/rfVarImpOOB documentation built on July 5, 2020, 6:50 p.m.