class_docstr: Record of multiple executions of a single metric.
  
  It contains a collection of `MetricObservation` instances.
  
  Args:
      direction: String. The direction of the metric to optimize. The value
          should be "min" or "max".
class_docstr_tok: ["Record","of","multiple","executions","of","a","single","metric",".","It","contains","a","collection","of","`","MetricObservation","`","instances",".","Args",":","direction",":","String",".","The","direction","of","the","metric","to","optimize",".","The","value","should","be","``","min","''","or","``","max","''","."]
code: def __init__(self, direction="min"):
      if direction not in {"min", "max"}:
          raise ValueError(
              "`direction` should be one of "
              '{"min", "max"}, but got: %s' % (direction,)
          )
      self.direction = direction
      # Mapping step to `MetricObservation`.
      self._observations = {}
  
imports: import inspect
  import numpy
  import six
  from keras_tuner import protos
  from keras_tuner.api_export import keras_tuner_export
  from keras_tuner.backend import keras
label_desc: Use image node_id 1 to create a new MetricHistory object  with example: obj = MetricHistory(direction)