MCPcopy Index your code
hub / github.com/clips/pattern / specificity

Function specificity

pattern/metrics.py:178–182  ·  view source on GitHub ↗

Returns the percentage of negative cases correctly classified as negative.

(classify=lambda document:False, documents=[])

Source from the content-addressed store, hash-verified

176 return recall(classify, document, average=None)
177
178def specificity(classify=lambda document:False, documents=[]):
179 """ Returns the percentage of negative cases correctly classified as negative.
180 """
181 TP, TN, FP, FN = confusion_matrix(classify, documents)
182 return float(TN) / ((TN + FP) or 1)
183
184TPR = sensitivity # true positive rate
185TNR = specificity # true negative rate

Callers

nothing calls this directly

Calls 1

confusion_matrixFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…