class_docstr: A combiner which computes metrics averaging regression errors.
class_docstr_tok: ["A","combiner","which","computes","metrics","averaging","regression","errors","."]
code: def add_input(
      self,
      accumulator: _MeanRegressionErrorAccumulator,
      element: metric_types.StandardMetricInputs,
  ) -> _MeanRegressionErrorAccumulator:
      lpe_iterator = metric_util.to_label_prediction_example_weight(
          element,
          eval_config=self._eval_config,
          model_name=self._metric_key.model_name,
          output_name=self._metric_key.output_name,
          aggregation_type=self._aggregation_type,
          class_weights=self._class_weights,
          example_weighted=self._example_weighted,
          sub_key=self._metric_key.sub_key,
      )
      for label, prediction, example_weight in lpe_iterator:
          # The np.item method makes sure the result is a one element numpy array
          # and returns the single element as a float.
          error = self._regression_error(label, prediction)
          if not np.isnan(error):
              accumulator.total_regression_error += (
                  error * metric_util.safe_to_scalar(example_weight)
              )
              accumulator.total_example_weights += (
                  metric_util.safe_to_scalar(example_weight)
              )
  
      return accumulator
  
imports: import abc
  import dataclasses
  from typing import Iterable, Optional, Dict
  import apache_beam
  import numpy
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 4 for calling the _MeanRegressionErrorCombiner obj's underlying member method code with example usage: obj.add_input(accumulator, element) and returns: accumulator