class_docstr: Abstract implementation of the surrogate model.
  
  Note
  ----
  The input dimensionality of Y for training and the output dimensions of all predictions depend on the concrete
  implementation of this abstract class.
  
  Parameters
  ----------
  configspace : ConfigurationSpace
  instance_features : dict[str, list[int | float]] | None, defaults to None
      Features (list of int or floats) of the instances (str). The features are incorporated into the X data,
      on which the model is trained on.
  pca_components : float, defaults to 7
      Number of components to keep when using PCA to reduce dimensionality of instance features.
  seed : int
class_docstr_tok: ["Abstract","implementation","of","the","surrogate","model",".","Note","--","--","The","input","dimensionality","of","Y","for","training","and","the","output","dimensions","of","all","predictions","depend","on","the","concrete","implementation","of","this","abstract","class",".","Parameters","--","--","--","--","--","configspace",":","ConfigurationSpace","instance_features",":","dict","[","str",",","list","[","int","|","float","]","]","|","None",",","defaults","to","None","Features","(","list","of","int","or","floats",")","of","the","instances","(","str",")",".","The","features","are","incorporated","into","the","X","data",",","on","which","the","model","is","trained","on",".","pca_components",":","float",",","defaults","to","7","Number","of","components","to","keep","when","using","PCA","to","reduce","dimensionality","of","instance","features",".","seed",":","int"]
code: def __init__(
      self,
      configspace: ConfigurationSpace,
      instance_features: dict[str, list[int | float]] | None = None,
      pca_components: int | None = 7,
      seed: int = 0,
  ) -> None:
      self._configspace = configspace
      self._seed = seed
      self._rng = np.random.RandomState(self._seed)
      self._instance_features = instance_features
      self._pca_components = pca_components
  
      n_features = 0
      if self._instance_features is not None:
          for v in self._instance_features.values():
              if n_features == 0:
                  n_features = len(v)
              else:
                  if len(v) != n_features:
                      raise RuntimeError(
                          "Instances must have the same number of features."
                      )
  
      self._n_features = n_features
      self._n_hps = len(self._configspace.get_hyperparameters())
  
      self._pca = PCA(n_components=self._pca_components)
      self._scaler = MinMaxScaler()
      self._apply_pca = False
  
      # Never use a lower variance than this.
      # If estimated variance < var_threshold, set to var_threshold
      self._var_threshold = VERY_SMALL_NUMBER
      self._types, self._bounds = get_types(
          configspace, instance_features
      )
  
      # Initial types array which is used to reset the type array at every call to `self.train()`
      self._initial_types = copy.deepcopy(self._types)
  
imports: from __future__ import annotations
  from abc import abstractmethod
  from typing import Any, TypeVar
  import copy
  import warnings
  import numpy
  from ConfigSpace import ConfigurationSpace
  from sklearn.decomposition import PCA
  from sklearn.exceptions import NotFittedError
  from sklearn.preprocessing import MinMaxScaler
  from smac.constants import VERY_SMALL_NUMBER
  from smac.utils.configspace import get_types
  from smac.utils.logging import get_logger
label_desc: Use image node_id 1 to create a new AbstractModel object  with example: obj = AbstractModel(configspace, instance_features, pca_components, seed)