class_docstr: The config selector handles the surrogate model and the acquisition function. Based on both components, the next
  configuration is selected.
  
  Parameters
  ----------
  retrain_after : int, defaults to 8
      How many configurations should be returned before the surrogate model is retrained.
  retries : int, defaults to 8
      How often to retry receiving a new configuration before giving up.
  min_trials: int, defaults to 1
      How many samples are required to train the surrogate model. If budgets are involved,
      the highest budgets are checked first. For example, if min_trials is three, but we find only
      two trials in the runhistory for the highest budget, we will use trials of a lower budget
      instead.
docstr: Collects the data from the runhistory to train the surrogate model. In the case of budgets, the data
  collection strategy is as follows: Looking from highest to lowest budget, return those observations
  that support at least ``self._min_trials`` points.
  
  If no budgets are used, this is equivalent to returning all observations.
docstr_tok: ["Collects","the","data","from","the","runhistory","to","train","the","surrogate","model",".","In","the","case","of","budgets",",","the","data","collection","strategy","is","as","follows",":","Looking","from","highest","to","lowest","budget",",","return","those","observations","that","support","at","least","``","self._min_trials","``","points",".","If","no","budgets","are","used",",","this","is","equivalent","to","returning","all","observations","."]
code: def _collect_data(self) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
      """Collects the data from the runhistory to train the surrogate model. In the case of budgets, the data
      collection strategy is as follows: Looking from highest to lowest budget, return those observations
      that support at least ``self._min_trials`` points.
  
      If no budgets are used, this is equivalent to returning all observations.
      """
      assert self._runhistory is not None
      assert self._runhistory_encoder is not None
  
      # If we use a float value as a budget, we want to train the model only on the highest budget
      unique_budgets: set[float] = {
          run_key.budget
          for run_key in self._runhistory
          if run_key.budget is not None
      }
  
      available_budgets: list[float] | list[None]
      if len(unique_budgets) > 0:
          # Sort available budgets from highest to lowest budget
          available_budgets = sorted(unique_budgets, reverse=True)
      else:
          available_budgets = [None]
  
      # Get #points per budget and if there are enough samples, then build a model
      for b in available_budgets:
          X, Y = self._runhistory_encoder.transform(budget_subset=[b])
  
          if X.shape[0] >= self._min_trials:
              self._considered_budgets = [b]
  
              # TODO: Add running configs
              configs_array = (
                  self._runhistory_encoder.get_configurations(
                      budget_subset=self._considered_budgets
                  )
              )
  
              return X, Y, configs_array
  
      return (
          np.empty(shape=[0, 0]),
          np.empty(
              shape=[
                  0,
              ]
          ),
          np.empty(shape=[0, 0]),
      )
  
imports: from __future__ import annotations
  from typing import Any, Iterator
  import copy
  import numpy
  from ConfigSpace import Configuration
  from smac.acquisition.function.abstract_acquisition_function import AbstractAcquisitionFunction
  from smac.acquisition.maximizer.abstract_acqusition_maximizer import AbstractAcquisitionMaximizer
  from smac.callback.callback import Callback
  from smac.initial_design import AbstractInitialDesign
  from smac.model.abstract_model import AbstractModel
  from smac.random_design.abstract_random_design import AbstractRandomDesign
  from smac.runhistory.encoder.abstract_encoder import AbstractRunHistoryEncoder
  from smac.runhistory.runhistory import RunHistory
  from smac.scenario import Scenario
  from smac.utils.logging import get_logger
label_desc: Use image node_id 7 for calling the ConfigSelector obj's underlying member method code with example usage: obj._collect_data() and returns: np,  np,  np, X,  Y,  configs_array