evalMetrics | R Documentation |
Compute selected evaluation metrics for binary (i.e. two-class) confusion matrices.
evalMetrics(mat, type = c("accuracy", "precision", "recall"))
mat |
Binary confusion |
type |
Target evaluation metric as |
A single numeric
.
Florian Detsch
University of Michigan (2017) Applied Machine Learning in Python. Available online: https://www.coursera.org/learn/python-machine-learning/home/welcome.
in1 = matrix(c(96, 4, 8, 19), nc = 2L, byrow = TRUE) rownames(in1) = c("Condition Positive", "Condition Negative") colnames(in1) = c("Predicted Positive", "Predicted Negative") evalMetrics(in1) # default: "accuracy" evalMetrics(in1, "precision") evalMetrics(in1, "recall") in2 = matrix(c(26, 17, 7, 400), nc = 2, byrow = TRUE) evalMetrics(in2, "precision") evalMetrics(in2, "recall")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.