Welcome to our Support Center

SpecificityAtSensitivity

Description

Computes best specificity where sensitivity is > specified value. Type : polymorphic.

 

 

Input parameters

 

 y_pred : array, predicted values.
 y_true : array, true values.
sensitivity : float, a scalar value in range [0 ,1].
 num_thresholds : integer, the number of thresholds to use for matching the given recall.

 

Output parameters

 

specificity_at_sensitivity : float, result.

Calculation

The SpecificityAtSensitivity metric is used to evaluate the performance of classification models. It calculates specificity, i.e. the ratio of true negatives to the sum of true negatives and false positives, at a specified sensitivity level. Sensitivity is the ratio of true positives to the sum of true positives and false negatives.
To calculate this metric, a number of thresholds (num_thresholds) are used. For each threshold, calculated as i / (num_thresholds – 1) where i ranges from 0 to num_thresholds, specificity and sensitivity are calculated.
Then, when sensitivity reaches or exceeds the specified value (sensitivity), the highest specificity obtained among all the thresholds is retained.

This metric offers a balance between specificity and sensitivity.

 

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install HAIBAL library to run it).

Easy to use

Table of Contents