
Precision TP/(TP+FP) (Geron Ch 3, morie.fn grpre)
Source:R/geron_train_native.R
morie_geron_precision.RdCounts delegated to morie_geron_confusion_matrix(); macro averaging
skips classes that were never predicted.
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
#>