code: def __init__(
      self,
      backend: Backend,
      queue: multiprocessing.Queue,
      metrics: Sequence[Scorer],
      additional_components: Dict[str, ThirdPartyComponents],
      port: Optional[int],
      configuration: Optional[Union[int, Configuration]] = None,
      scoring_functions: Optional[List[Scorer]] = None,
      seed: int = 1,
      output_y_hat_optimization: bool = True,
      resampling_strategy: Optional[
          Union[
              str, BaseCrossValidator, _RepeatedSplits, BaseShuffleSplit
          ]
      ] = None,
      resampling_strategy_args: Optional[
          Dict[str, Optional[Union[float, int, str]]]
      ] = None,
      num_run: Optional[int] = None,
      budget: Optional[float] = None,
      budget_type: Optional[str] = None,
      keep_models: bool = False,
      include: Optional[List[str]] = None,
      exclude: Optional[List[str]] = None,
      disable_file_output: bool = False,
      init_params: Optional[Dict[str, Any]] = None,
  ):
      super().__init__(
          backend=backend,
          queue=queue,
          port=port,
          configuration=configuration,
          metrics=metrics,
          additional_components=additional_components,
          scoring_functions=scoring_functions,
          seed=seed,
          output_y_hat_optimization=output_y_hat_optimization,
          num_run=num_run,
          include=include,
          exclude=exclude,
          disable_file_output=disable_file_output,
          init_params=init_params,
          budget=budget,
          budget_type=budget_type,
      )
  
      self.feat_type = self.backend.load_datamanager().feat_type
      self.resampling_strategy = resampling_strategy
      if resampling_strategy_args is None:
          self.resampling_strategy_args = {}
      else:
          self.resampling_strategy_args = resampling_strategy_args
      self.splitter = self.get_splitter(self.datamanager)
      self.num_cv_folds = self.splitter.get_n_splits(
          groups=self.resampling_strategy_args.get("groups")
      )
      self.X_train = self.datamanager.data["X_train"]
      self.Y_train = self.datamanager.data["Y_train"]
      self.X_targets = [None] * self.num_cv_folds
      self.Y_targets = [None] * self.num_cv_folds
      self.Y_train_targets = np.ones(self.Y_train.shape) * np.NaN
      self.models = [None] * self.num_cv_folds
      self.indices: List[Optional[Tuple[List[int], List[int]]]] = [
          None
      ] * self.num_cv_folds
  
      # Necessary for full CV. Makes full CV not write predictions if only
      # a subset of folds is evaluated but time is up. Complicated, because
      #  code must also work for partial CV, where we want exactly the
      # opposite.
      self.partial = True
      self.keep_models = keep_models
  
imports: from typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar, Union, cast
  import copy
  import json
  import logging
  import multiprocessing
  import warnings
  import numpy
  import pandas
  import pandas
  import scipy.sparse
  from ConfigSpace import Configuration
  from sklearn.base import BaseEstimator
  from sklearn.model_selection import BaseCrossValidator, KFold, PredefinedSplit, ShuffleSplit, StratifiedKFold, StratifiedShuffleSplit, train_test_split
  from sklearn.model_selection._split import BaseShuffleSplit, _RepeatedSplits
  from smac.tae import StatusType, TAEAbortException
  from autosklearn.automl_common.common.utils.backend import Backend
  from autosklearn.constants import CLASSIFICATION_TASKS, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRESSION_TASKS
  from autosklearn.data.abstract_data_manager import AbstractDataManager
  from autosklearn.data.validation import SUPPORTED_FEAT_TYPES, SUPPORTED_TARGET_TYPES
  from autosklearn.evaluation.abstract_evaluator import TYPE_ADDITIONAL_INFO, AbstractEvaluator, _fit_and_suppress_warnings
  from autosklearn.evaluation.splitter import CustomStratifiedKFold, CustomStratifiedShuffleSplit
  from autosklearn.metrics import Scorer
  from autosklearn.pipeline.base import PIPELINE_DATA_DTYPE
  from autosklearn.pipeline.components.base import IterativeComponent, ThirdPartyComponents
  from autosklearn.util.logging_ import PicklableClientLogger
label_desc: Use image node_id 1 to create a new TrainEvaluator object from inherited base classes: AbstractEvaluator with example: obj = TrainEvaluator(backend, queue, metrics, additional_components, port, configuration, scoring_functions, seed, output_y_hat_optimization, resampling_strategy, resampling_strategy_args, num_run, budget, budget_type, keep_models, include, exclude, disable_file_output, init_params)