docs: def plot_det_curve(y_true, scores, save_to,
                     distances=False, dpi=150):
      """DET curve
  
      This function will create (and overwrite) the following files:
          - {save_to}.det.png
          - {save_to}.det.eps
          - {save_to}.det.txt
  
      Parameters
      ----------
      y_true : (n_samples, ) array-like
          Boolean reference.
      scores : (n_samples, ) array-like
          Predicted score.
      save_to : str
          Files path prefix.
      distances : boolean, optional
          When True, indicate that `scores` are actually `distances`
      dpi : int, optional
          Resolution of .png file. Defaults to 150.
  
      Returns
      -------
      eer : float
          Equal error rate
      """
  
      fpr, fnr, thresholds, eer = det_curve(y_true, scores, distances=distances)
  
      # plot DET curve
      plt.figure(figsize=(12, 12))
      plt.loglog(fpr, fnr, 'b')
      plt.loglog([eer], [eer], 'bo')
      plt.xlabel('False Positive Rate')
      plt.ylabel('False Negative Rate')
      plt.xlim(1e-2, 1.)
      plt.ylim(1e-2, 1.)
      plt.grid(True)
      plt.tight_layout()
      plt.savefig(save_to + '.det.png', dpi=dpi)
      plt.savefig(save_to + '.det.eps')
      plt.close()
  
      # save DET curve in text file
      txt = save_to + '.det.txt'
      line = '{t:.6f} {fp:.6f} {fn:.6f}\n'
      with open(txt, 'w') as f:
          for i, (t, fp, fn) in enumerate(zip(thresholds, fpr, fnr)):
              f.write(line.format(t=t, fp=fp, fn=fn))
  
      return eer