Skip to content

Latest commit

 

History

History
168 lines (125 loc) · 3.34 KB

ClassificationMetric.md

File metadata and controls

168 lines (125 loc) · 3.34 KB

TFSimilarity.callbacks.ClassificationMetric

Abstract base class for computing classification metrics.

Inherits From: ABC

TFSimilarity.callbacks.ClassificationMetric(
    name: str = ,
    canonical_name: str = ,
    direction: str = max
) -> None

Args

name Name associated with a specific metric object, e.g., [email protected]
canonical_name The canonical name associated with metric, e.g., accuracy
direction 'max','min' the starting point of the search for the optimal distance threhsold.
  • max: Start at the max distance and search decreasing.
  • min: Start at the min distance and search increasing.

ClassificationMetric measure the matching classification between the query label and the label derived from the set of lookup results.

The compute() method supports computing the metric for a set of values, where each value represents the counts at a specific distance threshold.

Methods

compute

View source

compute(
    tp: <a href="../../TFSimilarity/callbacks/FloatTensor.md">TFSimilarity.callbacks.FloatTensor```
</a>,
    fp: <a href="../../TFSimilarity/callbacks/FloatTensor.md">TFSimilarity.callbacks.FloatTensor```
</a>,
    tn: <a href="../../TFSimilarity/callbacks/FloatTensor.md">TFSimilarity.callbacks.FloatTensor```
</a>,
    fn: <a href="../../TFSimilarity/callbacks/FloatTensor.md">TFSimilarity.callbacks.FloatTensor```
</a>,
    count: int
) -> <a href="../../TFSimilarity/callbacks/FloatTensor.md">TFSimilarity.callbacks.FloatTensor```
</a>

Compute the classification metric.

Args
tp A 1D FloatTensor containing the count of True Positives at each distance threshold.
fp A 1D FloatTensor containing the count of False Positives at each distance threshold.
tn A 1D FloatTensor containing the count of True Negatives at each distance threshold.
fn A 1D FloatTensor containing the count of False Negatives at each distance threshold.
count The total number of queries
Returns
A 1D FloatTensor containing the metric at each distance threshold.

get_config

View source

get_config()