View source: R/performance_measures.R
Prec | R Documentation |
'Prec()' computes the Precision of PPV (Positive Predictive Value) between the output of a classification model and the actual values of the target. The precision of each class can be aggregated. Macro-precision is the average of the precision of each classes. Micro-precision is the weighted average.
Prec(ct, multi.class = "macro")
ct |
Confusion Matrix. |
multi.class |
Should the results of each class be aggregated, and how? Options: "none", "macro", "micro". (Defaults: "macro"). |
PPV (a single value).
y <- c(rep("a",3),rep("b",2))
y_pred <- c(rep("a",2),rep("b",3))
ct <- table(y,y_pred)
Prec(ct)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.