Precision_macro_weighted: Precision (macro weighted average)

Description Usage Arguments Value Examples

View source: R/Classification.R

Description

Compute the precision score of multi-class problem using the "macro" formula but weighted averaged, similarly to Weka. details: https://sebastianraschka.com/faq/docs/multiclass-metric.html

Usage

1

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

Precision (macro weighted average)

Examples

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

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