class_docstr: FIGSExt (sum of trees) classifier.
  Fast Interpretable Greedy-Tree Sums (FIGS) is an algorithm for fitting concise rule-based models.
  Specifically, FIGS generalizes CART to simultaneously grow a flexible number of trees in a summation.
  The total number of splits across all the trees can be restricted by a pre-specified threshold, keeping the model interpretable.
  Experiments across a wide array of real-world datasets show that FIGS achieves state-of-the-art prediction performance when restricted to just a few splits (e.g. less than 20).
  https://arxiv.org/abs/2201.11931
docstr: Predict for a single tree
  This can be made way faster
code: def _predict_tree(self, root: Node, X):
      """Predict for a single tree
      This can be made way faster
      """
  
      def _predict_tree_single_point(root: Node, x):
          if root.split_or_linear == "linear":
              return x[root.feature] * root.value
          elif root.left is None and root.right is None:
              return root.value
          left = x[root.feature] <= root.threshold
          if left:
              if (
                  root.left is None
              ):  # we don't actually have to worry about this case
                  return root.value
              else:
                  return _predict_tree_single_point(root.left, x)
          else:
              if (
                  root.right is None
              ):  # we don't actually have to worry about this case
                  return root.value
              else:
                  return _predict_tree_single_point(root.right, x)
  
      preds = np.zeros(X.shape[0])
      for i in range(X.shape[0]):
          preds[i] = _predict_tree_single_point(root, X[i])
      return preds
  
imports: from copy import deepcopy
  import numpy
  from matplotlib import pyplot
  from sklearn import datasets
  from sklearn import tree
  from sklearn.base import BaseEstimator
  from sklearn.linear_model import RidgeCV, RidgeClassifierCV
  from sklearn.model_selection import train_test_split
  from sklearn.tree import plot_tree
  from sklearn.utils import check_X_y
  from imodels.tree.viz_utils import extract_sklearn_tree_from_figs
label_desc: Use image node_id 12 for calling the FIGSExt obj's underlying member method code with example usage: obj._predict_tree(root, X) and returns: preds, unknown, root, root, _predict_tree_single_point, root, _predict_tree_single_point