class_docstr: The performance transformer transforms performances into model outputs for
  supervised learning as well as model outputs to performance objects.
class_docstr_tok: ["The","performance","transformer","transforms","performances","into","model","outputs","for","supervised","learning","as","well","as","model","outputs","to","performance","objects","."]
docstr: Args:
      metrics: The performance metrics to transform. If `None`, all performance metrics are
          transformed. If provided, metrics that are not present will be converted into NaNs.
docstr_tok: ["Args",":","metrics",":","The","performance","metrics","to","transform",".","If","`","None","`",",","all","performance","metrics","are","transformed",".","If","provided",",","metrics","that","are","not","present","will","be","converted","into","NaNs","."]
code: def __init__(self, metrics: list[str] | None = None):
      """
      Args:
          metrics: The performance metrics to transform. If `None`, all performance metrics are
              transformed. If provided, metrics that are not present will be converted into NaNs.
      """
      self.encoder = PerformanceEncoder(metrics)
  
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 1 to create a new PerformanceTransformer object from inherited base classes: TransformerMixin with example: obj = PerformanceTransformer(metrics)