code: def compute_at_thresholds(
      fn, y_true, y_score, n_thresholds=10, start=0.0
  ):
      """
      Given scores, binarize them at different thresholds, then compute
      metrics
  
      Examples
      --------
      >>> from sklearn_evaluation.metrics import compute_at_thresholds
      >>> from sklearn.metrics import accuracy_score
      >>> from sklearn.metrics import precision_score, recall_score, f1_score
      >>> import numpy as np
      >>> y_true = np.array([1, 1, 1, 1, 1, 0, 0, 0, 0, 0])
      >>> y_score = np.array([1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1])
      >>> binarized = compute_at_thresholds([accuracy_score, precision_score,
      ...                                    recall_score, f1_score],
      ...                                    y_true, y_score)
      """
      if util.isiter(fn):
          (thresholds, Y_pred) = binarize.scores_at_thresholds(
              y_score, n_thresholds=n_thresholds
          )
          metrics = [
              np.array([fn_(y_true, y_pred) for y_pred in Y_pred])
              for fn_ in fn
          ]
          return thresholds, metrics
      else:
          (thresholds, Y_pred) = binarize.scores_at_thresholds(
              y_score, n_thresholds=n_thresholds
          )
          metrics = np.array([fn(y_true, y_pred) for y_pred in Y_pred])
          return thresholds, metrics
  
file_path: sklearn-evaluation/src/sklearn_evaluation/metrics.py
imports: import numpy
  from sklearn.metrics import precision_score
  from sklearn_evaluation.preprocessing import binarize
  from sklearn_evaluation import util
  from sklearn_evaluation import validate
label_desc: Use image node_id 1 for calling a global function with example usage: compute_at_thresholds(fn, y_true, y_score, n_thresholds, start) and returns: thresholds,  metrics, thresholds,  metrics