View source: R/evaluator-lib-utils.R
fp | R Documentation |
These functions calculate the fp()
(number of false positives)
of a measurement system compared to the reference results (the "truth").
fp(data, ...)
## S3 method for class 'data.frame'
fp(
data,
truth,
estimate,
estimator = NULL,
na_rm = FALSE,
case_weights = NULL,
event_level = "first",
...
)
fp_vec(
truth,
estimate,
estimator = NULL,
na_rm = FALSE,
case_weights = NULL,
event_level = "first",
...
)
data |
Either a |
... |
Not currently used. |
truth |
The column identifier for the true class results
(that is a |
estimate |
The column identifier for the predicted class
results (that is also |
estimator |
One of: |
na_rm |
A |
case_weights |
The optional column identifier for case weights.
This should be an unquoted column name that evaluates to a numeric column
in |
event_level |
A single string. Either |
A tibble
with columns .metric
, .estimator
, and
.estimate
with 1 row of values.
For grouped data frames, the number of rows returned will be the same as the number of groups.
For fp_vec()
, a single numeric
value (or NA
).
# Two class example data
two_class_example <- data.frame(
truth = as.factor(sample(c("Class1", "Class2"), 100, replace = TRUE)),
predicted = as.factor(sample(c("Class1", "Class2"), 100, replace = TRUE))
)
# Compute number of false positives
fp(two_class_example, truth = truth, estimate = predicted)
fp_vec(two_class_example$truth, two_class_example$predicted)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.