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 metrics: A string among the metrics listed in :const:`maximizing_metrics`.
  :returns: the threshold at which the given metric is maximal.
  
  :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.find_threshold_by_max_metric("f1")
docstr_tok: [":","param","metrics",":","A","string","among","the","metrics","listed","in",":","const",":","`","maximizing_metrics","`",".",":","returns",":","the","threshold","at","which","the","given","metric","is","maximal",".",":","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.find_threshold_by_max_metric","(","``","f1","''",")"]
code: def find_threshold_by_max_metric(self, metric):
      """
      :param metrics: A string among the metrics listed in :const:`maximizing_metrics`.
      :returns: the threshold at which the given metric is maximal.
  
      :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.find_threshold_by_max_metric("f1")
      """
      crit2d = self._metric_json["max_criteria_and_metric_scores"]
      # print(crit2d)
      h2o_metric = (
          H2OBinomialModelMetrics.metrics_aliases[metric]
          if metric in H2OBinomialModelMetrics.metrics_aliases
          else metric
      )
      for e in crit2d.cell_values:
          if e[0] == "max " + h2o_metric.lower():
              return e[1]
      raise ValueError("No metric " + str(metric.lower()))
  
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 30 for calling the H2OBinomialModelMetrics obj's underlying member method code with example usage: obj.find_threshold_by_max_metric(metric) and returns: e