class_docstr: The confusion matrix between a list of reference values and a
  corresponding list of test values.  Entry *[r,t]* of this
  matrix is a count of the number of times that the reference value
  *r* corresponds to the test value *t*.  E.g.:
  
      >>> from nltk.metrics import ConfusionMatrix
      >>> ref  = 'DET NN VB DET JJ NN NN IN DET NN'.split()
      >>> test = 'DET VB VB DET NN NN NN IN DET NN'.split()
      >>> cm = ConfusionMatrix(ref, test)
      >>> print(cm['NN', 'NN'])
      3
  
  Note that the diagonal entries *Ri=Tj* of this matrix
  corresponds to correct values; and the off-diagonal entries
  correspond to incorrect values.
class_docstr_tok: ["The","confusion","matrix","between","a","list","of","reference","values","and","a","corresponding","list","of","test","values",".","Entry","*","[","r",",","t","]","*","of","this","matrix","is","a","count","of","the","number","of","times","that","the","reference","value","*","r","*","corresponds","to","the","test","value","*","t","*",".","E.g",".",":",">",">",">","from","nltk.metrics","import","ConfusionMatrix",">",">",">","ref","=","'DET","NN","VB","DET","JJ","NN","NN","IN","DET","NN'.split","(",")",">",">",">","test","=","'DET","VB","VB","DET","NN","NN","NN","IN","DET","NN'.split","(",")",">",">",">","cm","=","ConfusionMatrix","(","ref",",","test",")",">",">",">","print","(","cm","[","'NN","'",",","'NN","'","]",")","3","Note","that","the","diagonal","entries","*","Ri=Tj","*","of","this","matrix","corresponds","to","correct","values",";","and","the","off-diagonal","entries","correspond","to","incorrect","values","."]
docstr: Given a value in the confusion matrix, return the recall
  that corresponds to this value. The recall is defined as:
  
  - *r* = true positive / (true positive + false positive)
  
  and can loosely be considered the ratio of how often ``value``
  was predicted correctly relative to how often ``value`` was
  the true result.
  
  :param value: value used in the ConfusionMatrix
  :return: the recall corresponding to ``value``.
  :rtype: float
docstr_tok: ["Given","a","value","in","the","confusion","matrix",",","return","the","recall","that","corresponds","to","this","value",".","The","recall","is","defined","as",":","-","*","r","*","=","true","positive","\/","(","true","positive","+","false","positive",")","and","can","loosely","be","considered","the","ratio","of","how","often","``","value","``","was","predicted","correctly","relative","to","how","often","``","value","``","was","the","true","result",".",":","param","value",":","value","used","in","the","ConfusionMatrix",":","return",":","the","recall","corresponding","to","``","value","``",".",":","rtype",":","float"]
code: def recall(self, value):
      """Given a value in the confusion matrix, return the recall
      that corresponds to this value. The recall is defined as:
  
      - *r* = true positive / (true positive + false positive)
  
      and can loosely be considered the ratio of how often ``value``
      was predicted correctly relative to how often ``value`` was
      the true result.
  
      :param value: value used in the ConfusionMatrix
      :return: the recall corresponding to ``value``.
      :rtype: float
      """
      # Number of times `value` was correct, and also predicted
      TP = self[value, value]
      # Number of times `value` was correct
      TP_FN = sum(
          self[value, pred_value] for pred_value in self._values
      )
      if TP_FN == 0:
          return 0.0
      return TP / TP_FN
  
file_path: nltk/nltk/metrics/confusionmatrix.py
imports: from nltk.probability import FreqDist
label_desc: Use image node_id 7 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.recall(value) and returns: unknown, int