class_docstr: Abstract class for preparing data in order to train a surrogate model.
  
  Parameters
  ----------
  scenario : Scenario object.
  considered_states : list[StatusType], defaults to [StatusType.SUCCESS, StatusType.CRASHED, StatusType.MEMORYOUT]  # noqa: E501
      Trials with the passed states are considered.
  lower_budget_states : list[StatusType], defaults to []
      Additionally consider all trials with these states for budget < current budget.
  scale_percentage : int, defaults to 5
      Scaled y-transformation use a percentile to estimate distance to optimum. Only used in some sub-classes.
  seed : int | None, defaults to none
  
  Raises
  ------
  TypeError
      If no success states are given.
docstr: Returns a vector representation of the RunHistory.
  
  Parameters
  ----------
  budget_subset : list | None, defaults to none
      List of budgets to consider.
  
  Returns
  -------
  X : np.ndarray
      Configuration vector and instance features.
  Y : np.ndarray
      Cost values.
docstr_tok: ["Returns","a","vector","representation","of","the","RunHistory",".","Parameters","--","--","--","--","--","budget_subset",":","list","|","None",",","defaults","to","none","List","of","budgets","to","consider",".","Returns","--","--","--","-","X",":","np.ndarray","Configuration","vector","and","instance","features",".","Y",":","np.ndarray","Cost","values","."]
code: def transform(
      self,
      budget_subset: list | None = None,
  ) -> tuple[np.ndarray, np.ndarray]:
      """Returns a vector representation of the RunHistory.
  
      Parameters
      ----------
      budget_subset : list | None, defaults to none
          List of budgets to consider.
  
      Returns
      -------
      X : np.ndarray
          Configuration vector and instance features.
      Y : np.ndarray
          Cost values.
      """
      logger.debug("Transforming RunHistory into X, y format...")
  
      considered_trials = self._get_considered_trials(budget_subset)
      X, Y = self._build_matrix(
          trials=considered_trials, store_statistics=True
      )
  
      # Get real TIMEOUT runs
      timeout_trials = self._get_timeout_trials(budget_subset)
  
      # Use penalization (e.g. PAR10) for EPM training
      store_statistics = (
          True if np.any(np.isnan(self._min_y)) else False
      )
      tX, tY = self._build_matrix(
          trials=timeout_trials, store_statistics=store_statistics
      )
  
      # If we don't have successful runs, we have to return all timeout runs
      if not considered_trials:
          return tX, tY
  
      # If we do not impute, we also return TIMEOUT data
      X = np.vstack((X, tX))
      Y = np.concatenate((Y, tY))
  
      logger.debug("Converted %d observations." % (X.shape[0]))
      return X, Y
  
imports: from __future__ import annotations
  from abc import abstractmethod
  from typing import Any, Mapping
  import numpy
  from smac.multi_objective import AbstractMultiObjectiveAlgorithm
  from smac.runhistory.runhistory import RunHistory, TrialKey, TrialValue
  from smac.runner.abstract_runner import StatusType
  from smac.scenario import Scenario
  from smac.utils.configspace import convert_configurations_to_array
  from smac.utils.logging import get_logger
label_desc: Use image node_id 11 for calling the AbstractRunHistoryEncoder obj's underlying member method code with example usage: obj.transform(budget_subset) and returns: X,  Y, tX,  tY