GetPrecision {Buddle} | R Documentation |
Obtaining Accuracy.
Description
Compute measures of accuracy such as precision, recall, and F1 from a given confusion matrix.
Usage
GetPrecision(confusion.matrix)
Arguments
confusion.matrix |
a confusion matrix. |
Value
An (r+1)-by-3 matrix when the input is an r-by-r confusion matrix.
See Also
CheckNonNumeric(), FetchBuddle(), MakeConfusionMatrix(), OneHot2Label(), Split2TrainTest(), TrainBuddle()
Examples
data(iris)
Label = c("setosa", "versicolor", "virginica")
predicted.label = c("setosa", "setosa", "virginica", "setosa", "versicolor", "versicolor")
true.label = c("setosa", "virginica", "versicolor","setosa", "versicolor", "virginica")
confusion.matrix = MakeConfusionMatrix(predicted.label, true.label, Label)
precision = GetPrecision(confusion.matrix)
confusion.matrix
precision
[Package Buddle version 2.0.1 Index]