dx_fowlkes_mallows | R Documentation |
Calculates the Fowlkes-Mallows Index (FM Index) for the provided confusion matrix. FM Index is the geometric mean of precision and recall, providing a balance measure between these two metrics.
dx_fowlkes_mallows(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. |
Fowlkes-Mallows Index is defined as the geometric mean of the precision (Positive Predictive Value) and recall (True Positive Rate or Sensitivity). It's a useful measure when you want a balance between precision and recall without the harshness of the harmonic mean used in F1 score. A higher Fowlkes-Mallows Index indicates better precision and recall balance.
The formula for Fowlkes-Mallows Index is:
FM = \sqrt{Precision \times Recall}
Depending on the detail
parameter, returns a numeric value
representing the calculated metric or a data frame/tibble with
detailed diagnostics including confidence intervals and possibly other
metrics relevant to understanding the metric.
dx_cm()
to understand how to create and interact with a 'dx_cm' object.
dx_ppv()
, dx_sensitivity()
for components of FM Index.
cm <- dx_cm(dx_heart_failure$predicted, dx_heart_failure$truth, threshold = 0.5, poslabel = 1)
simple_fm_index <- dx_fowlkes_mallows(cm, detail = "simple")
detailed_fm_index <- dx_fowlkes_mallows(cm)
print(simple_fm_index)
print(detailed_fm_index)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.