F1_Score_macro: F1 Score (macro averaged)

Description Usage Arguments Value Examples

View source: R/Classification.R

Description

Compute the F1 Score of multi-class problem using the "macro" average. details: https://sebastianraschka.com/faq/docs/multiclass-metric.html

Usage

1
F1_Score_macro(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

F1 Score (macro averaged)

Examples

1
2
3
4
labels <- c("Q1","Q2","Q3","Q4")
truth <- sample(labels, 10, replace = TRUE)
pred <- sample(labels, 10, replace = TRUE)
F1_Score_macro(y_pred = pred, y_true = truth, labels)

LqNoob/Machine-Learning-Evaluation-Metrics documentation built on May 20, 2019, 3:33 p.m.