Welcome to our Support Center



Calculates the number of true negatives. Type : polymorphic.



Input parameters


Β y_pred :Β array,Β predicted values (logits values).
Β y_true :Β array,Β true values (logits values, or binary values if the threshold value is between 0 and 1).
Β thresholds :Β float,Β representing the threshold for deciding whether prediction and true values are 1 or 0 (above the threshold is true, below is false).


Output parameters


true_negatives : float, result.

Use cases

The “TrueNegatives” metric is commonly used in machine learning, particularly for binary classification tasks. This metric counts the number of true negatives, i.e. the number of samples that have been correctly classified as negative by the model.

Here are some examples of specific areas where “TrueNegatives” can be used :

    • Spam detection : as mentioned above, in spam detection, true negatives are correctly identified non-spam emails.
    • Medical diagnosis : in disease classification, a true negative would be a healthy patient correctly identified as such.
    • Fraud detection : in the financial field, a true negative would be a non-fraudulent transaction that has been correctly identified as such.



“TrueNegatives” metric is used in the context of binary classification.

A “True Negative” (TN) occurs when a model correctly predicts the negative class for an example that is actually of the negative class. In other words, the model predicted that the event would not occur, and it did not.



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