Acc {kerntools} | R Documentation |
Accuracy
Description
'Acc()' computes the accuracy between the output of a classification model and the actual values of the target. It can also compute the weighted accuracy, which is useful in imbalanced classification problems. The weighting is applied according to the class frequencies in the target. In balanced problems, weighted Acc = Acc.
Usage
Acc(ct, weighted = FALSE)
Arguments
ct |
Confusion Matrix. |
weighted |
If TRUE, the weighted accuracy is returned. (Defaults: FALSE). |
Value
Accuracy of the model (a single value).
Examples
y <- c(rep("a",3),rep("b",2))
y_pred <- c(rep("a",2),rep("b",3))
ct <- table(y,y_pred)
Acc(ct)
Acc(ct,weighted=TRUE)
[Package kerntools version 1.0.2 Index]