dx_f2 | R Documentation |
Calculates the F2 score from a confusion matrix object with an option to include bootstrapped confidence intervals. The F2 score weights recall higher than precision.
dx_f2(cm, detail = "full", boot = FALSE, bootreps = 1000)
cm |
A dx_cm object created by |
detail |
Character specifying the level of detail in the output: "simple" for raw estimate, "full" for detailed estimate including 95% confidence intervals. |
boot |
Logical specifying if confidence intervals should be generated via bootstrapping. Note, this can be slow. |
bootreps |
The number of bootstrap replications for calculating confidence intervals. |
Depending on the detail
parameter, returns a single numeric value of
F2 or a data frame with the F2 and its confidence intervals.
dx_fbeta()
, dx_f1()
for other F-beta scores.
cm <- dx_cm(dx_heart_failure$predicted, dx_heart_failure$truth,
threshold =
0.5, poslabel = 1
)
simple_f <- dx_f2(cm, detail = "simple")
detailed_f <- dx_f2(cm)
print(simple_f)
print(detailed_f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.