Welcome to our Support Center



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



Input parameters


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


Output parameters


sensitivity_at_specificity : float, result.

Use cases

The Sensitivity at Specificity metric is mainly used in binary classification tasks, particularly in the medical field, where it is particularly relevant.

Here are a few specific areas where it is used :

    • Medical : Sensitivity at Specificity is used to evaluate the performance of diagnostic tests.
    • Other fields of application : This metric may also be relevant in other fields of application where it is important to balance the rate of false positives and true positives, such as fraud detection or anomaly detection.



The SensitivityAtSpecificity metric is used to evaluate the performance of classification models. It calculates sensitivity, which is the ratio of true positives to the sum of true positives and false negatives, at a specified level of specificity. Specificity is the ratio of true negatives to the sum of true negatives and false positives.
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, sensitivity and specificity are calculated.
Then, when the specificity reaches or exceeds the specified value, the highest sensitivity obtained among all the thresholds is used.

This metric offers a balance between sensitivity and specificity.



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