class_error | R Documentation |
Calculates Classification Metrics
class_error(
true,
estimated,
estimated.prob = NULL,
calc.auc = TRUE,
calc.brier = TRUE,
auc.method = c("pROC", "ROCR", "auc_pairs"),
trace = 0
)
true |
Factor: True labels |
estimated |
Factor: Estimated values |
estimated.prob |
Numeric vector: Estimated probabilities |
calc.auc |
Logical: If TRUE, calculate AUC. May be slow in very large datasets. |
calc.brier |
Logical: If TRUE, calculate Brier Score |
auc.method |
Character: "pROC", "ROCR", "auc_pairs": Method to use, passed to auc. |
trace |
Integer: If > 0, print diagnostic messages. Default = 0 |
Note that auc.method = "pROC" is the only one that will output an AUC even if one or more estimated probabilities are NA.
S3 object of type "class_error"
E.D. Gennatas
## Not run:
true <- factor(c("a", "a", "a", "b", "b", "b", "b", "b", "b", "b"))
estimated <- factor(c("a", "a", "b", "b", "a", "a", "b", "b", "a", "a"))
estimated.prob <- c(0.7, 0.55, 0.45, 0.25, 0.6, 0.7, 0.2, .37, .57, .61)
class_error(true, estimated, estimated.prob, auc.method = "pROC")
class_error(true, estimated, estimated.prob, auc.method = "ROCR")
class_error(true, estimated, estimated.prob, auc.method = "auc_pairs")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.