docstr: Evaluate decision function output for X relative to y_true.
  
  Parameters
  ----------
  clf : object
      Trained classifier to use for scoring. Must have either a
      decision_function method or a predict_proba method; the output of
      that is used to compute the score.
  
  X : array-like or sparse matrix
      Test data that will be fed to clf.decision_function or
      clf.predict_proba.
  
  y : array-like
      Gold standard target values for X. These must be class labels,
      not decision function values.
  
  sample_weight : array-like, optional (default=None)
      Sample weights.
  
  Returns
  -------
  score : float
      Score function applied to prediction of estimator on X.
docstr_tok: ["Evaluate","decision","function","output","for","X","relative","to","y_true",".","Parameters","--","--","--","--","--","clf",":","object","Trained","classifier","to","use","for","scoring",".","Must","have","either","a","decision_function","method","or","a","predict_proba","method",";","the","output","of","that","is","used","to","compute","the","score",".","X",":","array-like","or","sparse","matrix","Test","data","that","will","be","fed","to","clf.decision_function","or","clf.predict_proba",".","y",":","array-like","Gold","standard","target","values","for","X",".","These","must","be","class","labels",",","not","decision","function","values",".","sample_weight",":","array-like",",","optional","(","default=None",")","Sample","weights",".","Returns","--","--","--","-","score",":","float","Score","function","applied","to","prediction","of","estimator","on","X","."]
code: def __call__(self, clf, X, y, sample_weight=None):
      """Evaluate decision function output for X relative to y_true.
  
      Parameters
      ----------
      clf : object
          Trained classifier to use for scoring. Must have either a
          decision_function method or a predict_proba method; the output of
          that is used to compute the score.
  
      X : array-like or sparse matrix
          Test data that will be fed to clf.decision_function or
          clf.predict_proba.
  
      y : array-like
          Gold standard target values for X. These must be class labels,
          not decision function values.
  
      sample_weight : array-like, optional (default=None)
          Sample weights.
  
      Returns
      -------
      score : float
          Score function applied to prediction of estimator on X.
      """
      super(_ThresholdScorer, self).__call__(
          clf, X, y, sample_weight=sample_weight
      )
      y_type = type_of_target(y)
      if y_type not in ("binary", "multilabel-indicator"):
          raise ValueError("{0} format is not supported".format(y_type))
  
      if is_regressor(clf):
          y_pred = clf.predict(X)
      else:
          try:
              y_pred = clf.decision_function(X)
  
              # For multi-output multi-class estimator
              if isinstance(y_pred, list):
                  y_pred = np.vstack(p for p in y_pred).T
  
          except (NotImplementedError, AttributeError):
              y_pred = clf.predict_proba(X)
  
              if y_type == "binary":
                  y_pred = y_pred[:, 1]
              elif isinstance(y_pred, list):
                  y_pred = np.vstack([p[:, -1] for p in y_pred]).T
  
      if sample_weight is not None:
          return self._sign * self._score_func(
              y, y_pred, sample_weight=sample_weight, **self._kwargs
          )
      else:
          return self._sign * self._score_func(
              y, y_pred, **self._kwargs
          )
  
imports: from abc import ABCMeta, abstractmethod
  import warnings
  import numpy
  from .None import r2_score, median_absolute_error, mean_absolute_error, mean_squared_error, accuracy_score, f1_score, roc_auc_score, average_precision_score, precision_score, recall_score, log_loss
  from .cluster import adjusted_rand_score
  from ..utils.multiclass import type_of_target
  from ..externals import six
  from ..base import is_regressor
label_desc: Use image node_id 1 for calling the _ThresholdScorer obj's underlying member method code with example usage: obj.__call__(clf, X, y, sample_weight) and returns: unknown, unknown