class_docstr: The XGBoost surrogate predicts a model's performance on a new dataset by
  using independent XGBoost regressors for each performance metric.
  
  For this, models and hyperparameters are converted to feature vectors.
class_docstr_tok: ["The","XGBoost","surrogate","predicts","a","model","'s","performance","on","a","new","dataset","by","using","independent","XGBoost","regressors","for","each","performance","metric",".","For","this",",","models","and","hyperparameters","are","converted","to","feature","vectors","."]
docstr: Args:
      tracker: A tracker that can be used to impute latency and number of model parameters
          into model performances. Also, it is required for some input features.
      objective: The optimization objective for the XGBoost estimators.
      use_simple_dataset_features: Whether to use dataset features to predict using a
          weighted average.
      use_seasonal_naive_performance: Whether to use the Seasonal Naïve nCRPS as dataset
          featuers. Requires the cacher to be set.
      use_catch22_features: Whether to use catch22 features for datasets statistics. Ignored
          if `use_dataset_features` is not set.
      predict: The metrics to predict. All if not provided.
      output_normalization: The type of normalization to apply to the features of each
          dataset independently. `None` applies no normalization, "quantile" applies quantile
          normalization, and "standard" transforms data to have zero mean and unit variance.
      impute_simulatable: Whether the tracker should impute latency and number of model
          parameters into the returned performance object.
docstr_tok: ["Args",":","tracker",":","A","tracker","that","can","be","used","to","impute","latency","and","number","of","model","parameters","into","model","performances",".","Also",",","it","is","required","for","some","input","features",".","objective",":","The","optimization","objective","for","the","XGBoost","estimators",".","use_simple_dataset_features",":","Whether","to","use","dataset","features","to","predict","using","a","weighted","average",".","use_seasonal_naive_performance",":","Whether","to","use","the","Seasonal","Na\u00efve","nCRPS","as","dataset","featuers",".","Requires","the","cacher","to","be","set",".","use_catch22_features",":","Whether","to","use","catch22","features","for","datasets","statistics",".","Ignored","if","`","use_dataset_features","`","is","not","set",".","predict",":","The","metrics","to","predict",".","All","if","not","provided",".","output_normalization",":","The","type","of","normalization","to","apply","to","the","features","of","each","dataset","independently",".","`","None","`","applies","no","normalization",",","``","quantile","''","applies","quantile","normalization",",","and","``","standard","''","transforms","data","to","have","zero","mean","and","unit","variance",".","impute_simulatable",":","Whether","the","tracker","should","impute","latency","and","number","of","model","parameters","into","the","returned","performance","object","."]
code: def __init__(
      self,
      tracker: ModelTracker,
      objective: Literal["regression", "ranking"] = "regression",
      use_simple_dataset_features: bool = False,
      use_seasonal_naive_performance: bool = False,
      use_catch22_features: bool = False,
      predict: Optional[List[str]] = None,
      output_normalization: OutputNormalization = None,
      impute_simulatable: bool = False,
  ):
      """
      Args:
          tracker: A tracker that can be used to impute latency and number of model parameters
              into model performances. Also, it is required for some input features.
          objective: The optimization objective for the XGBoost estimators.
          use_simple_dataset_features: Whether to use dataset features to predict using a
              weighted average.
          use_seasonal_naive_performance: Whether to use the Seasonal Naïve nCRPS as dataset
              featuers. Requires the cacher to be set.
          use_catch22_features: Whether to use catch22 features for datasets statistics. Ignored
              if `use_dataset_features` is not set.
          predict: The metrics to predict. All if not provided.
          output_normalization: The type of normalization to apply to the features of each
              dataset independently. `None` applies no normalization, "quantile" applies quantile
              normalization, and "standard" transforms data to have zero mean and unit variance.
          impute_simulatable: Whether the tracker should impute latency and number of model
              parameters into the returned performance object.
      """
      super().__init__(
          tracker, predict, output_normalization, impute_simulatable
      )
  
      self.use_ranking = objective == "ranking"
      self.config_transformer = ConfigTransformer(
          add_model_features=True,
          add_dataset_statistics=use_simple_dataset_features,
          add_seasonal_naive_performance=use_seasonal_naive_performance,
          add_catch22_features=use_catch22_features,
          tracker=tracker,
      )
  
      if self.use_ranking:
          base_estimator = XGBRanker(
              objective="rank:pairwise", nthread=4
          )
      else:
          base_estimator = XGBRegressor(nthread=4)
      self.estimator = MultiOutputRegressor(base_estimator)
  
file_path: gluonts/src/gluonts/nursery/tsbench/src/tsbench/surrogate/xgboost.py
imports: from typing import List, Literal, Optional
  import numpy
  import numpy.typing
  from sklearn.multioutput import MultiOutputRegressor
  from sklearn.preprocessing import LabelEncoder
  from xgboost.sklearn import XGBRanker, XGBRegressor
  from tsbench.config import Config, ModelConfig
  from tsbench.evaluations.tracking import ModelTracker
  from ._base import DatasetFeaturesMixin, OutputNormalization, Surrogate
  from ._factory import register_surrogate
  from .transformers import ConfigTransformer
label_desc: Use image node_id 1 to create a new XGBoostSurrogate object from inherited base classes: Surrogate, DatasetFeaturesMixin with example: obj = XGBoostSurrogate(tracker, objective, use_simple_dataset_features, use_seasonal_naive_performance, use_catch22_features, predict, output_normalization, impute_simulatable)