dx_markedness | R Documentation |
Calculates Markedness for the provided confusion matrix. Markedness is a combined measure of PPV (Positive Predictive Value) and NPV (Negative Predictive Value). It reflects the effectiveness of a classifier in marking class labels correctly, ranging from -1 to 1.
dx_markedness(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. |
Markedness is defined as Markedness = PPV + NPV - 1
. It is the sum of the proportions
of predicted positives that are true positives (PPV) and the proportion of predicted negatives
that are true negatives (NPV) minus one. It's a useful measure when you want to consider both
the positive and negative predictive values of a test. A higher markedness indicates better performance.
The formula for Markedness is:
Markedness = PPV + NPV - 1
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_npv()
for components of markedness.
cm <- dx_cm(dx_heart_failure$predicted, dx_heart_failure$truth, threshold = 0.5, poslabel = 1)
simple_markedness <- dx_markedness(cm, detail = "simple")
detailed_markedness <- dx_markedness(cm)
print(simple_markedness)
print(detailed_markedness)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.