class_docstr: Random forest that takes instance features into account.
  
  Parameters
  ----------
  n_trees : int, defaults to `N_TREES`
      The number of trees in the random forest.
  n_points_per_tree : int, defaults to -1
      Number of points per tree. If the value is smaller than 0, the number of samples will be used.
  ratio_features : float, defaults to 5.0 / 6.0
      The ratio of features that are considered for splitting.
  min_samples_split : int, defaults to 3
      The minimum number of data points to perform a split.
  min_samples_leaf : int, defaults to 3
      The minimum number of data points in a leaf.
  max_depth : int, defaults to 2**20
      The maximum depth of a single tree.
  eps_purity : float, defaults to 1e-8
      The minimum difference between two target values to be considered.
  max_nodes : int, defaults to 2**20
      The maximum total number of nodes in a tree.
  bootstrapping : bool, defaults to True
      Enables bootstrapping.
  log_y: bool, defaults to False
      The y values (passed to this random forest) are expected to be log(y) transformed.
      This will be considered during predicting.
  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: ["Random","forest","that","takes","instance","features","into","account",".","Parameters","--","--","--","--","--","n_trees",":","int",",","defaults","to","`","N_TREES","`","The","number","of","trees","in","the","random","forest",".","n_points_per_tree",":","int",",","defaults","to","-1","Number","of","points","per","tree",".","If","the","value","is","smaller","than","0",",","the","number","of","samples","will","be","used",".","ratio_features",":","float",",","defaults","to","5.0","\/","6.0","The","ratio","of","features","that","are","considered","for","splitting",".","min_samples_split",":","int",",","defaults","to","3","The","minimum","number","of","data","points","to","perform","a","split",".","min_samples_leaf",":","int",",","defaults","to","3","The","minimum","number","of","data","points","in","a","leaf",".","max_depth",":","int",",","defaults","to","2","*","*","20","The","maximum","depth","of","a","single","tree",".","eps_purity",":","float",",","defaults","to","1e-8","The","minimum","difference","between","two","target","values","to","be","considered",".","max_nodes",":","int",",","defaults","to","2","*","*","20","The","maximum","total","number","of","nodes","in","a","tree",".","bootstrapping",":","bool",",","defaults","to","True","Enables","bootstrapping",".","log_y",":","bool",",","defaults","to","False","The","y","values","(","passed","to","this","random","forest",")","are","expected","to","be","log","(","y",")","transformed",".","This","will","be","considered","during","predicting",".","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,
      n_trees: int = N_TREES,
      n_points_per_tree: int = -1,
      ratio_features: float = 5.0 / 6.0,
      min_samples_split: int = 3,
      min_samples_leaf: int = 3,
      max_depth: int = 2**20,
      eps_purity: float = 1e-8,
      max_nodes: int = 2**20,
      bootstrapping: bool = True,
      log_y: bool = False,
      instance_features: dict[str, list[int | float]] | None = None,
      pca_components: int | None = 7,
      seed: int = 0,
  ) -> None:
      super().__init__(
          configspace=configspace,
          instance_features=instance_features,
          pca_components=pca_components,
          seed=seed,
      )
  
      max_features = (
          0
          if ratio_features > 1.0
          else max(1, int(len(self._types) * ratio_features))
      )
  
      self._rf_opts = regression.forest_opts()
      self._rf_opts.num_trees = n_trees
      self._rf_opts.do_bootstrapping = bootstrapping
      self._rf_opts.tree_opts.max_features = max_features
      self._rf_opts.tree_opts.min_samples_to_split = min_samples_split
      self._rf_opts.tree_opts.min_samples_in_leaf = min_samples_leaf
      self._rf_opts.tree_opts.max_depth = max_depth
      self._rf_opts.tree_opts.epsilon_purity = eps_purity
      self._rf_opts.tree_opts.max_num_nodes = max_nodes
      self._rf_opts.compute_law_of_total_variance = False
      self._rf: BinaryForest | None = None
      self._log_y = log_y
      self._rng = regression.default_random_engine(seed)
  
      self._n_trees = n_trees
      self._n_points_per_tree = n_points_per_tree
      self._ratio_features = ratio_features
      self._min_samples_split = min_samples_split
      self._min_samples_leaf = min_samples_leaf
      self._max_depth = max_depth
      self._eps_purity = eps_purity
      self._max_nodes = max_nodes
      self._bootstrapping = bootstrapping
  
file_path: SMAC3/smac/model/random_forest/random_forest.py
imports: from __future__ import annotations
  from typing import Any
  import numpy
  from ConfigSpace import ConfigurationSpace
  from pyrfr import regression
  from pyrfr.regression import binary_rss_forest
  from pyrfr.regression import default_data_container
  from smac.constants import N_TREES, VERY_SMALL_NUMBER
  from smac.model.random_forest import AbstractRandomForest
label_desc: Use image node_id 1 to create a new RandomForest object from inherited base classes: AbstractRandomForest with example: obj = RandomForest(configspace, n_trees, n_points_per_tree, ratio_features, min_samples_split, min_samples_leaf, max_depth, eps_purity, max_nodes, bootstrapping, log_y, instance_features, pca_components, seed)