CCExtractor Development

Write a Python function to calculate the True Negative Rate (TNR) of classification data.

Write a Python function to calculate the True Negative Rate (TNR) of Red Hen classification guesses / predictions for audio clips.

Please see: https://en.wikipedia.org/wiki/Confusion_matrix

Assume the existence of the variables p, n, tp, tn, fp, and fn.

For example, a function that calculates the True Positive Rate (TPR) is:

def tpr(tp, fn):
    return tp / (tp + fn)

Task tags

  • python

Students who completed this task

CodeNinja

Task type

  • code Code
  • done_all Quality Assurance

Level

Beginner
close

2017