class_docstr: Base class for triplets learners.
class_docstr_tok: ["Base","class","for","triplets","learners","."]
docstr: Predicts differences between sample distances in input triplets.
  
  For each triplet (X_a, X_b, X_c) in the samples, computes the difference
  between the learned distance of the second pair (X_a, X_c) minus the
  learned distance of the first pair (X_a, X_b). The higher it is, the more
  probable it is that the pairs in the triplets are presented in the right
  order, i.e. that the label of the triplet is 1. The lower it is, the more
  probable it is that the label of the triplet is -1.
  
  Parameters
  ----------
  triplet : array-like, shape=(n_triplets, 3, n_features) or                   (n_triplets, 3)
    3D array of triplets to predict, with each row corresponding to three
    points, or 2D array of indices of triplets if the metric learner
    uses a preprocessor.
  
  Returns
  -------
  decision_function : `numpy.ndarray` of floats, shape=(n_constraints,)
    Metric differences.
docstr_tok: ["Predicts","differences","between","sample","distances","in","input","triplets",".","For","each","triplet","(","X_a",",","X_b",",","X_c",")","in","the","samples",",","computes","the","difference","between","the","learned","distance","of","the","second","pair","(","X_a",",","X_c",")","minus","the","learned","distance","of","the","first","pair","(","X_a",",","X_b",")",".","The","higher","it","is",",","the","more","probable","it","is","that","the","pairs","in","the","triplets","are","presented","in","the","right","order",",","i.e",".","that","the","label","of","the","triplet","is","1",".","The","lower","it","is",",","the","more","probable","it","is","that","the","label","of","the","triplet","is","-1",".","Parameters","--","--","--","--","--","triplet",":","array-like",",","shape=","(","n_triplets",",","3",",","n_features",")","or","(","n_triplets",",","3",")","3D","array","of","triplets","to","predict",",","with","each","row","corresponding","to","three","points",",","or","2D","array","of","indices","of","triplets","if","the","metric","learner","uses","a","preprocessor",".","Returns","--","--","--","-","decision_function",":","`","numpy.ndarray","`","of","floats",",","shape=","(","n_constraints",",",")","Metric","differences","."]
code: def decision_function(self, triplets):
      """Predicts differences between sample distances in input triplets.
  
      For each triplet (X_a, X_b, X_c) in the samples, computes the difference
      between the learned distance of the second pair (X_a, X_c) minus the
      learned distance of the first pair (X_a, X_b). The higher it is, the more
      probable it is that the pairs in the triplets are presented in the right
      order, i.e. that the label of the triplet is 1. The lower it is, the more
      probable it is that the label of the triplet is -1.
  
      Parameters
      ----------
      triplet : array-like, shape=(n_triplets, 3, n_features) or \
                    (n_triplets, 3)
        3D array of triplets to predict, with each row corresponding to three
        points, or 2D array of indices of triplets if the metric learner
        uses a preprocessor.
  
      Returns
      -------
      decision_function : `numpy.ndarray` of floats, shape=(n_constraints,)
        Metric differences.
      """
      check_is_fitted(self, "preprocessor_")
      triplets = check_input(
          triplets,
          type_of_inputs="tuples",
          preprocessor=self.preprocessor_,
          estimator=self,
          tuple_size=self._tuple_size,
      )
      return self.pair_score(triplets[:, :2]) - self.pair_score(
          triplets[:, [0, 2]]
      )
  
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 2 for calling the _TripletsClassifierMixin obj's underlying member method code with example usage: obj.decision_function(triplets) and returns: unknown