Skip to contents

Counts delegated to morie_geron_confusion_matrix(); macro averaging skips classes that were never predicted.

Usage

morie_geron_precision(y_true, y_pred, positive = 1, average = NULL)

Arguments

y_true, y_pred

Integer labels.

positive

0-based positive class when average is NULL.

average

NULL or "macro".

Value

List with precision, tp, fp, per_class.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_precision(V, V)
#> $precision
#> [1] 1
#> 
#> $tp
#> [1] 1
#> 
#> $fp
#> [1] 0
#> 
#> $per_class
#> [1] NA  1  1  1  1  1  1  1  1
#> 
#> $estimate
#> [1] 1
#> 
#> $n
#> [1] 8
#>