Compute the recall score of multi-class problem using the "micro" average. details: https://sebastianraschka.com/faq/docs/multiclass-metric.html

Recall_micro(y_true, y_pred, labels = NULL)

Arguments

y_true

Ground truth (correct) labels vector

y_pred

Predicted labels vector, as returned by a classifier

labels

An optional vector containing the list of the existent (unique) labels.

Value

Recall (micro averaged)

Examples

labels <- c("Q1", "Q2", "Q3", "Q4")
truth <- sample(labels, 10, replace = TRUE)
pred <- sample(labels, 10, replace = TRUE)
Recall_micro(y_pred = pred, y_true = truth, labels)
#> [1] 0.2