Basic metrics {mldr}R Documentation

Multi-label evaluation metrics

Description

Several evaluation metrics designed for multi-label problems.

Usage

hamming_loss(true_labels, predicted_labels)

subset_accuracy(true_labels, predicted_labels)

Arguments

true_labels

Matrix of true labels, columns corresponding to labels and rows to instances.

predicted_labels

Matrix of predicted labels, columns corresponding to labels and rows to instances.

Details

Available metrics in this category

Value

Resulting value in the range [0, 1]

See Also

mldr_evaluate, mldr_to_labels

Other evaluation metrics: Averaged metrics, Ranking-based metrics

Examples

true_labels <- matrix(c(
1,1,1,
0,0,0,
1,0,0,
1,1,1,
0,0,0,
1,0,0
), ncol = 3, byrow = TRUE)
predicted_labels <- matrix(c(
1,1,1,
0,0,0,
1,0,0,
1,1,0,
1,0,0,
0,1,0
), ncol = 3, byrow = TRUE)

hamming_loss(true_labels, predicted_labels)
subset_accuracy(true_labels, predicted_labels)

[Package mldr version 0.4.3 Index]