code: def __init__(
      self,
      tree: "sklearn.tree._tree.Tree",
      search_spaces: numpy.ndarray,
  ) -> None:
      assert search_spaces.shape[0] == tree.n_features
      assert search_spaces.shape[1] == 2
  
      self._tree = tree
      self._search_spaces = search_spaces
  
      statistics = self._precompute_statistics()
      (
          split_midpoints,
          split_sizes,
      ) = self._precompute_split_midpoints_and_sizes()
      subtree_active_features = (
          self._precompute_subtree_active_features()
      )
  
      self._statistics = statistics
      self._split_midpoints = split_midpoints
      self._split_sizes = split_sizes
      self._subtree_active_features = subtree_active_features
      self._variance = None
  
imports: from __future__ import annotations
  from functools import lru_cache
  import itertools
  from typing import List
  from typing import Set
  from typing import Tuple
  from typing import TYPE_CHECKING
  from typing import Union
  import numpy
label_desc: Use image node_id 1 to create a new _FanovaTree object  with example: obj = _FanovaTree(tree, search_spaces)