sensitivity: Calculate Sensitivity (True Positive Rate, Recall)

sensitivityR Documentation

Calculate Sensitivity (True Positive Rate, Recall)

Description

Calculates Sensitivity, also known as the True Positive Rate (TPR) or recall, which is the proportion of actual positives that are correctly identified as such by the classifier. Sensitivity is a key measure in evaluating the effectiveness of a classifier in identifying positive instances.

Usage

dx_sensitivity(cm, detail = "full", ...)

dx_recall(cm, detail = "full", ...)

dx_tpr(cm, detail = "full", ...)

Arguments

cm

A dx_cm object created by dx_cm().

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 citype for type of confidence interval method.

Details

Sensitivity or TPR is an important measure in scenarios where missing a positive identification has serious consequences. It essentially measures the proportion of actual positives that are correctly identified, giving insight into the ability of the classifier to detect positive instances. A higher sensitivity indicates a better performance in recognizing positive instances.

The formula for Sensitivity is:

Sensitivity = \frac{True Positives}{True Positives + False Negatives}

Value

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.

See Also

dx_cm() to understand how to create and interact with a 'dx_cm' object.

Examples

cm <- dx_cm(dx_heart_failure$predicted, dx_heart_failure$truth,
  threshold =
    0.5, poslabel = 1
)
simple_sensitivity <- dx_sensitivity(cm, detail = "simple")
detailed_sensitivity <- dx_sensitivity(cm)
print(simple_sensitivity)
print(detailed_sensitivity)

overdodactyl/diagnosticSummary documentation built on Jan. 28, 2024, 10:07 a.m.