class_docstr: Base class for pairs learners.
  
  Attributes
  ----------
  threshold_ : `float`
    If the distance metric between two points is lower than this threshold,
    points will be classified as similar, otherwise they will be
    classified as dissimilar.
class_docstr_tok: ["Base","class","for","pairs","learners",".","Attributes","--","--","--","--","--","threshold_",":","`","float","`","If","the","distance","metric","between","two","points","is","lower","than","this","threshold",",","points","will","be","classified","as","similar",",","otherwise","they","will","be","classified","as","dissimilar","."]
docstr: Sets the threshold of the metric learner to the given value `threshold`.
  
  See more in the :ref:`User Guide <calibration>`.
  
  Parameters
  ----------
  threshold : float
    The threshold value we want to set. It is the value to which the
    predicted distance for test pairs will be compared. If they are superior
    to the threshold they will be classified as similar (+1),
    and dissimilar (-1) if not.
  
  Returns
  -------
  self : `_PairsClassifier`
    The pairs classifier with the new threshold set.
docstr_tok: ["Sets","the","threshold","of","the","metric","learner","to","the","given","value","`","threshold","`",".","See","more","in","the",":","ref",":","`","User","Guide","<","calibration",">","`",".","Parameters","--","--","--","--","--","threshold",":","float","The","threshold","value","we","want","to","set",".","It","is","the","value","to","which","the","predicted","distance","for","test","pairs","will","be","compared",".","If","they","are","superior","to","the","threshold","they","will","be","classified","as","similar","(","+1",")",",","and","dissimilar","(","-1",")","if","not",".","Returns","--","--","--","-","self",":","`","_PairsClassifier","`","The","pairs","classifier","with","the","new","threshold","set","."]
code: def set_threshold(self, threshold):
      """Sets the threshold of the metric learner to the given value `threshold`.
  
      See more in the :ref:`User Guide <calibration>`.
  
      Parameters
      ----------
      threshold : float
        The threshold value we want to set. It is the value to which the
        predicted distance for test pairs will be compared. If they are superior
        to the threshold they will be classified as similar (+1),
        and dissimilar (-1) if not.
  
      Returns
      -------
      self : `_PairsClassifier`
        The pairs classifier with the new threshold set.
      """
      check_is_fitted(self, "preprocessor_")
      try:
          self.threshold_ = float(threshold)
      except TypeError:
          raise ValueError(
              "Parameter threshold must be a real number. "
              "Got {} instead.".format(type(threshold))
          )
      except ValueError:
          raise ValueError(
              "Parameter threshold must be a real number. "
              "Got {} instead.".format(type(threshold))
          )
      return self
  
imports: from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.utils.extmath import stable_cumsum
  from sklearn.utils.validation import _is_arraylike, check_is_fitted
  from sklearn.metrics import roc_auc_score, roc_curve, precision_recall_curve
  import numpy
  from abc import ABCMeta, abstractmethod
  from ._util import ArrayIndexer, check_input, validate_vector
  import warnings
label_desc: Use image node_id 4 for calling the _PairsClassifierMixin obj's underlying member method code with example usage: obj.set_threshold(threshold) and returns: self