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.
code: def __init__(
      self,
      scenario: Scenario,
      considered_states: list[StatusType] = [
          StatusType.SUCCESS,
          StatusType.CRASHED,
          StatusType.MEMORYOUT,
      ],
      lower_budget_states: list[StatusType] = [],
      scale_percentage: int = 5,
      seed: int | None = None,
  ) -> None:
      if considered_states is None:
          raise TypeError("No success states are given.")
  
      if seed is None:
          seed = scenario.seed
  
      self._seed = seed
      self._rng = np.random.RandomState(seed)
      self._scale_percentage = scale_percentage
      self._n_objectives = scenario.count_objectives()
      self._algorithm_walltime_limit = scenario.trial_walltime_limit
      self._lower_budget_states = lower_budget_states
      self._considered_states = considered_states
  
      self._instances = scenario.instances
      self._instance_features = scenario.instance_features
      self._n_features = scenario.count_instance_features()
      self._n_params = len(scenario.configspace.get_hyperparameters())
  
      if self._instances is not None and self._n_features == 0:
          logger.warning(
              "We strongly encourage to use instance features when using instances.",
              "If no instance features are passed, the runhistory encoder can not distinguish between different "
              "instances and therefore returns the same data points with different values, all of which are "
              "used to train the surrogate model.\n"
              "Consider using instance indices as features.",
          )
  
      # Learned statistics
      self._min_y = np.array([np.NaN] * self._n_objectives)
      self._max_y = np.array([np.NaN] * self._n_objectives)
      self._percentile = np.array([np.NaN] * self._n_objectives)
      self._multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None = (
          None
      )
      self._runhistory: RunHistory | None = None
  
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 1 to create a new AbstractRunHistoryEncoder object  with example: obj = AbstractRunHistoryEncoder(scenario, considered_states, lower_budget_states, scale_percentage, seed)