code: def ber(tp, tn, fp, fn):
      
      return (fp / float(tn + fp) + fn / float(fn + tp)) / 2
docs: Balanced Error Rate [0, 1]
      
      :param int tp: number of true positives
      :param int tn: number of true negatives
      :param int fp: number of false positives
      :param int fn: number of false negatives
      :rtype: float