class_docstr: Recommender that selects a set of configurations differently in the one-
  dimensional and two- dimensional setting.
  
  In the one-dimensional setting, it greedily picks the configurations which
  provide the lowest joint error. In the multi-dimensional setting, it
  greedily picks the configurations which provide the lowest joint
  hypervolume error.
code: def fit(
      self,
      configs: List[Config[ModelConfig]],
      performances: List[Performance],
  ) -> None:
      super().fit(configs, performances)
  
      # We need to sort by dataset to have the same ordering for each model config
      ordering = np.argsort([c.dataset.name() for c in configs])
      performance_df = Performance.to_dataframe(performances)
  
      # Extract all metrics
      metric_map = defaultdict(list)
      for i in ordering:
          metric_map[configs[i].model].append(
              performance_df.iloc[i][self.objectives].to_numpy(),  # type: ignore
          )
  
      # Build the properties
      self.metrics = np.stack(list(metric_map.values()), axis=1)
      self.model_indices = {
          model: i for i, model in enumerate(metric_map)
      }
  
      # If we are in the multi-objective setting, we have to apply dataset-level quantile
      # normalization of each objective. Otherwise, we perform standardization.
      if not self.enforce_single_objective and len(self.objectives) > 1:
          transformer = QuantileTransformer(
              n_quantiles=min(1000, self.metrics.shape[0])
          )
          self.metrics = np.stack(
              [
                  transformer.fit_transform(dataset_metrics)
                  for dataset_metrics in self.metrics
              ]
          )
      else:
          transformer = StandardScaler()
          self.metrics = np.stack(
              [
                  transformer.fit_transform(dataset_metrics)
                  for dataset_metrics in self.metrics
              ]
          )
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/recommender/greedy.py
imports: from collections import defaultdict
  from typing import Dict, List, Optional
  import numpy
  import pygmo
  from sklearn.preprocessing import QuantileTransformer, StandardScaler
  from tsbench.config import Config, DatasetConfig, ModelConfig
  from tsbench.evaluations.metrics import Performance
  from ._base import Recommendation, Recommender
  from ._factory import register_recommender
  from .generator import CandidateGenerator
label_desc: Use image node_id 2 for calling the GreedyRecommender obj's underlying member method code with example usage: obj.fit(configs, performances) without return types