class_docstr: Takes the mean of the best models, where the models are ranked according to
  the value of an evaluation metric.
docstr: :param metric: the evaluation metric to use
  :param abs_score: whether to take the absolute value of the model
      outputs. Useful for anomaly detection.
docstr_tok: [":","param","metric",":","the","evaluation","metric","to","use",":","param","abs_score",":","whether","to","take","the","absolute","value","of","the","model","outputs",".","Useful","for","anomaly","detection","."]
code: def __init__(
      self,
      metric: Union[str, TSADMetric, ForecastMetric],
      abs_score=False,
  ):
      """
      :param metric: the evaluation metric to use
      :param abs_score: whether to take the absolute value of the model
          outputs. Useful for anomaly detection.
      """
      super().__init__(abs_score=abs_score)
      if isinstance(metric, str):
          metric_cls, name = metric.split(".", maxsplit=1)
          metric_cls = {
              c.__name__: c for c in [ForecastMetric, TSADMetric]
          }[metric_cls]
          metric = metric_cls[name]
      self.metric = metric
      self.metric_values = None
  
imports: from abc import abstractmethod
  from collections import OrderedDict
  import copy
  import logging
  from typing import List, Optional, Union
  import numpy
  from merlion.evaluate.anomaly import TSADMetric
  from merlion.evaluate.forecast import ForecastMetric
  from merlion.utils import UnivariateTimeSeries, TimeSeries
  from merlion.utils.misc import AutodocABCMeta
label_desc: Use image node_id 1 to create a new ModelSelector object from inherited base classes: Mean with example: obj = ModelSelector(metric, abs_score)