class_docstr: This class is essentially an API for the AUC object.
  This class contains methods for inspecting the AUC for different criteria.
  To input the different criteria, use the static variable ``criteria``.
docstr: :param str metric: A metric among :const:`maximizing_metrics`.
  :param thresholds: thresholds parameter must be a list (e.g. ``[0.01, 0.5, 0.99]``).
      If None, then the threshold maximizing the metric will be used.
      If 'all', then all stored thresholds are used and returned with the matching metric.
  :returns: The set of metrics for the list of thresholds.
      The returned list has a 'value' property holding only
      the metric value (if no threshold provided or if provided as a number),
      or all the metric values (if thresholds provided as a list)
  
  :examples:
  
  >>> from h2o.estimators.gbm import H2OGradientBoostingEstimator
  >>> local_data = [[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],
  ...               [1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],
  ...               [0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],
  ...               [0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b']]
  >>> h2o_data = h2o.H2OFrame(local_data)
  >>> h2o_data.set_names(['response', 'predictor'])
  >>> h2o_data["response"] = h2o_data["response"].asfactor()
  >>> gbm = H2OGradientBoostingEstimator(ntrees=1,
  ...                                    distribution="bernoulli")
  >>> gbm.train(x=list(range(1,h2o_data.ncol)),
  ...           y="response",
  ...           training_frame=h2o_data)
  >>> perf = gbm.model_performance()
  >>> perf.metric("tps", [perf.find_threshold_by_max_metric("f1")])[0][1]
docstr_tok: [":","param","str","metric",":","A","metric","among",":","const",":","`","maximizing_metrics","`",".",":","param","thresholds",":","thresholds","parameter","must","be","a","list","(","e.g",".","``","[","0.01",",","0.5",",","0.99","]","``",")",".","If","None",",","then","the","threshold","maximizing","the","metric","will","be","used",".","If","'all","'",",","then","all","stored","thresholds","are","used","and","returned","with","the","matching","metric",".",":","returns",":","The","set","of","metrics","for","the","list","of","thresholds",".","The","returned","list","has","a","'value","'","property","holding","only","the","metric","value","(","if","no","threshold","provided","or","if","provided","as","a","number",")",",","or","all","the","metric","values","(","if","thresholds","provided","as","a","list",")",":","examples",":",">",">",">","from","h2o.estimators.gbm","import","H2OGradientBoostingEstimator",">",">",">","local_data","=","[","[","1",",","'","a","'","]",",","[","1",",","'","a","'","]",",","[","1",",","'","a","'","]",",","[","1",",","'","a","'","]",",","[","1",",","'","a","'","]",",","...","[","1",",","'","a","'","]",",","[","1",",","'","a","'","]",",","[","1",",","'","a","'","]",",","[","1",",","'","a","'","]",",","[","1",",","'","a","'","]",",","...","[","0",",","'","b","'","]",",","[","0",",","'","b","'","]",",","[","0",",","'","b","'","]",",","[","0",",","'","b","'","]",",","[","0",",","'","b","'","]",",","...","[","0",",","'","b","'","]",",","[","0",",","'","b","'","]",",","[","0",",","'","b","'","]",",","[","0",",","'","b","'","]",",","[","0",",","'","b","'","]","]",">",">",">","h2o_data","=","h2o.H2OFrame","(","local_data",")",">",">",">","h2o_data.set_names","(","[","'response","'",",","'predictor","'","]",")",">",">",">","h2o_data","[","``","response","''","]","=","h2o_data","[","``","response","''","]",".asfactor","(",")",">",">",">","gbm","=","H2OGradientBoostingEstimator","(","ntrees=1",",","...","distribution=","''","bernoulli","''",")",">",">",">","gbm.train","(","x=list","(","range","(","1",",","h2o_data.ncol",")",")",",","...","y=","''","response","''",",","...","training_frame=h2o_data",")",">",">",">","perf","=","gbm.model_performance","(",")",">",">",">","perf.metric","(","``","tps","''",",","[","perf.find_threshold_by_max_metric","(","``","f1","''",")","]",")","[","0","]","[","1","]"]
code: def metric(self, metric, thresholds=None):
      """
      :param str metric: A metric among :const:`maximizing_metrics`.
      :param thresholds: thresholds parameter must be a list (e.g. ``[0.01, 0.5, 0.99]``).
          If None, then the threshold maximizing the metric will be used.
          If 'all', then all stored thresholds are used and returned with the matching metric.
      :returns: The set of metrics for the list of thresholds.
          The returned list has a 'value' property holding only
          the metric value (if no threshold provided or if provided as a number),
          or all the metric values (if thresholds provided as a list)
  
      :examples:
  
      >>> from h2o.estimators.gbm import H2OGradientBoostingEstimator
      >>> local_data = [[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],
      ...               [1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],[1, 'a'],
      ...               [0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],
      ...               [0, 'b'],[0, 'b'],[0, 'b'],[0, 'b'],[0, 'b']]
      >>> h2o_data = h2o.H2OFrame(local_data)
      >>> h2o_data.set_names(['response', 'predictor'])
      >>> h2o_data["response"] = h2o_data["response"].asfactor()
      >>> gbm = H2OGradientBoostingEstimator(ntrees=1,
      ...                                    distribution="bernoulli")
      >>> gbm.train(x=list(range(1,h2o_data.ncol)),
      ...           y="response",
      ...           training_frame=h2o_data)
      >>> perf = gbm.model_performance()
      >>> perf.metric("tps", [perf.find_threshold_by_max_metric("f1")])[0][1]
      """
      assert_is_type(thresholds, None, "all", numeric, [numeric])
      if metric not in H2OBinomialModelMetrics.maximizing_metrics:
          raise ValueError(
              "The only allowable metrics are {}".format(
                  ", ".join(H2OBinomialModelMetrics.maximizing_metrics)
              )
          )
  
      h2o_metric = (
          H2OBinomialModelMetrics.metrics_aliases[metric]
          if metric in H2OBinomialModelMetrics.metrics_aliases
          else metric
      )
      value_is_scalar = is_type(metric, str) and (
          thresholds is None or is_type(thresholds, numeric)
      )
      if thresholds is None:
          thresholds = [self.find_threshold_by_max_metric(h2o_metric)]
      elif thresholds == "all":
          thresholds = None
      elif is_type(thresholds, numeric):
          thresholds = [thresholds]
  
      metrics = List()
      thresh2d = self._metric_json["thresholds_and_metric_scores"]
      if (
          thresholds is None
      ):  # fast path to return all thresholds: skipping find_idx logic
          metrics.extend(
              list(t)
              for t in zip(thresh2d["threshold"], thresh2d[h2o_metric])
          )
      else:
          for t in thresholds:
              idx = self.find_idx_by_threshold(t)
              metrics.append([t, thresh2d[h2o_metric][idx]])
  
      setattr(
          metrics,
          "value",
          metrics[0][1]
          if value_is_scalar
          else list(r[1] for r in metrics),
      )
      return metrics
  
imports: import h2o
  from h2o.model import MetricsBase, ConfusionMatrix
  from h2o.plot import get_matplotlib_pyplot, decorate_plot_result, RAISE_ON_FIGURE_ACCESS
  from h2o.utils.metaclass import deprecated_params
  from h2o.utils.shared_utils import List
  from h2o.utils.typechecks import assert_is_type, numeric, is_type, assert_satisfies
label_desc: Use image node_id 22 for calling the H2OBinomialModelMetrics obj's underlying member method code with example usage: obj.metric(metric, thresholds) and returns: metrics