code: def fit(
      self, X: list[Performance], _y: Any = None
  ) -> PerformanceEncoder:
      df = Performance.to_dataframe(X)
      self.all_feature_names_ = df.columns.tolist()
      if self.metrics is None:
          self.feature_names_ = df.columns.tolist()
      else:
          assert all(m in df.columns for m in self.metrics)
          self.feature_names_ = self.metrics
      return self
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/surrogate/transformers/performance.py
imports: from __future__ import annotations
  from typing import Any, List, Optional
  import numpy
  import numpy.typing
  import pandas
  from sklearn.base import TransformerMixin
  from tsbench.evaluations.metrics import Performance
label_desc: Use image node_id 2 for calling the PerformanceEncoder obj's underlying member method code with example usage: obj.fit(X, _y) and returns: self