Learn R Programming

MLmetrics (version 1.1.1)

MultiLogLoss: Multi Class Log Loss

Description

Compute the multi class log loss.

Usage

MultiLogLoss(y_pred, y_true)

Value

Multi Class Log Loss

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

Examples

Run this code
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"))

Run the code above in your browser using DataLab