class_docstr: Calculate the average precision and average precision at n.
docstr: Normalize the predictions to the range between 0.0 and 1.0.
  
  For some predictions like SVM predictions, we need to normalize them before
  calculate the interpolated average precision. The normalization will not
  change the rank in the original list and thus won't change the average
  precision.
  
  Args:
    predictions: a numpy 1-D array storing the sparse prediction scores.
    epsilon: a small constant to avoid denominator being zero.
  
  Returns:
    The normalized prediction.
docstr_tok: ["Normalize","the","predictions","to","the","range","between","0.0","and","1.0",".","For","some","predictions","like","SVM","predictions",",","we","need","to","normalize","them","before","calculate","the","interpolated","average","precision",".","The","normalization","will","not","change","the","rank","in","the","original","list","and","thus","wo","n't","change","the","average","precision",".","Args",":","predictions",":","a","numpy","1-D","array","storing","the","sparse","prediction","scores",".","epsilon",":","a","small","constant","to","avoid","denominator","being","zero",".","Returns",":","The","normalized","prediction","."]
code: def _zero_one_normalize(predictions, epsilon=1e-7):
      """Normalize the predictions to the range between 0.0 and 1.0.
  
      For some predictions like SVM predictions, we need to normalize them before
      calculate the interpolated average precision. The normalization will not
      change the rank in the original list and thus won't change the average
      precision.
  
      Args:
        predictions: a numpy 1-D array storing the sparse prediction scores.
        epsilon: a small constant to avoid denominator being zero.
  
      Returns:
        The normalized prediction.
      """
      denominator = numpy.max(predictions) - numpy.min(predictions)
      ret = (predictions - numpy.min(predictions)) / numpy.max(
          denominator, epsilon
      )
      return ret
  
file_path: PaddleHub/modules/video/classification/videotag_tsn_lstm/resource/metrics/youtube8m/average_precision_calculator.py
imports: import heapq
  import random
  import numbers
  import numpy
label_desc: Use image node_id 10 for calling the AveragePrecisionCalculator obj's underlying member method code with example usage: obj._zero_one_normalize(predictions, epsilon) and returns: ret