class_docstr: Base class for triplets learners.
class_docstr_tok: ["Base","class","for","triplets","learners","."]
docstr: Predicts the ordering between sample distances in input triplets.
  
  For each triplets, returns 1 if the first element is closer to the second
  than to the last and -1 if not.
  
  Parameters
  ----------
  triplets : 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
  -------
  prediction : `numpy.ndarray` of floats, shape=(n_constraints,)
    Predictions of the ordering of pairs, for each triplet.
docstr_tok: ["Predicts","the","ordering","between","sample","distances","in","input","triplets",".","For","each","triplets",",","returns","1","if","the","first","element","is","closer","to","the","second","than","to","the","last","and","-1","if","not",".","Parameters","--","--","--","--","--","triplets",":","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","--","--","--","-","prediction",":","`","numpy.ndarray","`","of","floats",",","shape=","(","n_constraints",",",")","Predictions","of","the","ordering","of","pairs",",","for","each","triplet","."]
code: def predict(self, triplets):
      """Predicts the ordering between sample distances in input triplets.
  
      For each triplets, returns 1 if the first element is closer to the second
      than to the last and -1 if not.
  
      Parameters
      ----------
      triplets : 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
      -------
      prediction : `numpy.ndarray` of floats, shape=(n_constraints,)
        Predictions of the ordering of pairs, for each triplet.
      """
      return 2 * (self.decision_function(triplets) > 0) - 1
  
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 1 for calling the _TripletsClassifierMixin obj's underlying member method code with example usage: obj.predict(triplets) and returns: unknown