dx_npv | R Documentation |
Calculates the proportion of true negatives out of the total predicted negatives (true negatives + false negatives), known as the Negative Predictive Value (NPV). This metric is a measure of the classifier's ability to identify negatives correctly. Note that NPV, like other metrics, may not fully represent classifier performance in unbalanced datasets and should be used alongside other metrics.
dx_npv(cm, detail = "full", ...)
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. |
... |
Additional arguments to pass to metric_binomial function, such as
|
NPV is the ratio of true negatives to the sum of true and false negatives. It is an indicator of how well the classifier can identify negative instances. High NPV means that the classifier is reliable in its negative classifications. However, it may be influenced by the prevalence of the condition and is best used in conjunction with other metrics like PPV, sensitivity, and specificity for a comprehensive evaluation.
The formula for NPV is:
NPV = \frac{True Negatives}{True Negatives + False Negatives}
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.
cm <- dx_cm(dx_heart_failure$predicted, dx_heart_failure$truth,
threshold =
0.5, poslabel = 1
)
simple_npv <- dx_npv(cm, detail = "simple")
detailed_npv <- dx_npv(cm)
print(simple_npv)
print(detailed_npv)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.