class_docstr: A recommender uses a surrogate to recommend models and their configurations
  based on desired target metrics.
  
  This class implements the general interface.
docstr: Args:
      objectives: The list of performance metrics to minimize.
      focus: The metric to prefer. Must be either in the list of objectives. If not
          provided, the first metric to optimize is chosen.
      generator: The generator that generates configurations for recommendations. By default,
          this is the replay candidate generator.
docstr_tok: ["Args",":","objectives",":","The","list","of","performance","metrics","to","minimize",".","focus",":","The","metric","to","prefer",".","Must","be","either","in","the","list","of","objectives",".","If","not","provided",",","the","first","metric","to","optimize","is","chosen",".","generator",":","The","generator","that","generates","configurations","for","recommendations",".","By","default",",","this","is","the","replay","candidate","generator","."]
code: def __init__(
      self,
      objectives: List[str],
      focus: Optional[str] = None,
      generator: Optional[CandidateGenerator[T]] = None,
  ):
      """
      Args:
          objectives: The list of performance metrics to minimize.
          focus: The metric to prefer. Must be either in the list of objectives. If not
              provided, the first metric to optimize is chosen.
          generator: The generator that generates configurations for recommendations. By default,
              this is the replay candidate generator.
      """
      # Assertions
      assert len(objectives) > 0, "No metrics provided."
  
      assert (
          focus is None or focus in objectives
      ), "Focus metric not found in metrics to optimize."
  
      # Initialize attributes
      self.generator = generator or ReplayCandidateGenerator()
      self.objectives = objectives
      self.focus = focus
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/recommender/_base.py
imports: from abc import ABC
  from typing import cast, Generic, List, Optional, TypeVar
  from tsbench.config import Config, DatasetConfig, EnsembleConfig, ModelConfig
  from tsbench.evaluations.metrics import Performance
  from ._recommendation import Recommendation
  from .generator import CandidateGenerator, ReplayCandidateGenerator
  from .utils import argsort_nondominated
label_desc: Use image node_id 1 to create a new Recommender object from inherited base classes: ABC, Generic with example: obj = Recommender(objectives, focus, generator)