class_docstr: Evaluates candidate ensemble performance.
docstr: Initializes a new Evaluator instance.
  
  Args:
    input_fn: Input function returning a tuple of: features - Dictionary of
      string feature name to `Tensor`. labels - `Tensor` of labels.
    metric_name: The name of the evaluation metrics to use when choosing the
      best ensemble. Must refer to a valid evaluation metric.
    objective: Either `Objective.MINIMIZE` or `Objective.MAXIMIZE`.
    steps: Number of steps for which to evaluate the ensembles. If an
      `OutOfRangeError` occurs, evaluation stops. If set to None, will iterate
      the dataset until all inputs are exhausted.
  
  Returns:
    An :class:`adanet.Evaluator` instance.
docstr_tok: ["Initializes","a","new","Evaluator","instance",".","Args",":","input_fn",":","Input","function","returning","a","tuple","of",":","features","-","Dictionary","of","string","feature","name","to","`","Tensor","`",".","labels","-","`","Tensor","`","of","labels",".","metric_name",":","The","name","of","the","evaluation","metrics","to","use","when","choosing","the","best","ensemble",".","Must","refer","to","a","valid","evaluation","metric",".","objective",":","Either","`","Objective.MINIMIZE","`","or","`","Objective.MAXIMIZE","`",".","steps",":","Number","of","steps","for","which","to","evaluate","the","ensembles",".","If","an","`","OutOfRangeError","`","occurs",",","evaluation","stops",".","If","set","to","None",",","will","iterate","the","dataset","until","all","inputs","are","exhausted",".","Returns",":","An",":","class",":","`","adanet.Evaluator","`","instance","."]
code: def __init__(
      self,
      input_fn,
      metric_name="adanet_loss",
      objective=Objective.MINIMIZE,
      steps=None,
  ):
      """Initializes a new Evaluator instance.
  
      Args:
        input_fn: Input function returning a tuple of: features - Dictionary of
          string feature name to `Tensor`. labels - `Tensor` of labels.
        metric_name: The name of the evaluation metrics to use when choosing the
          best ensemble. Must refer to a valid evaluation metric.
        objective: Either `Objective.MINIMIZE` or `Objective.MAXIMIZE`.
        steps: Number of steps for which to evaluate the ensembles. If an
          `OutOfRangeError` occurs, evaluation stops. If set to None, will iterate
          the dataset until all inputs are exhausted.
  
      Returns:
        An :class:`adanet.Evaluator` instance.
      """
      self._input_fn = input_fn
      self._steps = steps
      self._metric_name = metric_name
      self._objective = objective
      if objective == self.Objective.MINIMIZE:
          self._objective_fn = np.nanargmin
      elif objective == self.Objective.MAXIMIZE:
          self._objective_fn = np.nanargmax
      else:
          raise ValueError(
              "Evaluator objective must be one of MINIMIZE or MAXIMIZE."
          )
  
file_path: adanet/adanet/core/evaluator.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl import logging
  from adanet import tf_compat
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 1 to create a new Evaluator object from inherited base classes: object with example: obj = Evaluator(input_fn, metric_name, objective, steps)