MultiLogLoss: Multi Class Log Loss

Description Usage Arguments Value Examples

View source: R/Classification.R

Description

Compute the multi class log loss.

Usage

1
MultiLogLoss(y_pred, y_true)

Arguments

y_pred

Predicted probabilities matrix, as returned by a classifier

y_true

Ground truth (correct) labels vector or a matrix of correct labels indicating by 0-1, same format as probabilities matrix

Value

Multi Class Log Loss

Examples

1
2
3
4
data(iris)
svm.model <- e1071::svm(Species~., data = iris, probability = TRUE)
pred <- predict(svm.model, iris, probability = TRUE)
MultiLogLoss(y_true = iris$Species, y_pred = attr(pred, "probabilities"))

Example output

Attaching package: 'MLmetrics'

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

    Recall

[1] 0.07931921

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