class_docstr: FIGS (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 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
class_docstr_tok: ["FIGS","(","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","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"]
code: def __str__(self):
      if not hasattr(self, "trees_"):
          s = self.__class__.__name__
          s += "("
          s += "max_rules="
          s += repr(self.max_rules)
          s += ")"
          return s
      else:
          s = "> ------------------------------\n"
          s += "> FIGS-Fast Interpretable Greedy-Tree Sums:\n"
          s += '> \tPredictions are made by summing the "Val" reached by traversing each tree.\n'
          s += "> \tFor classifiers, a sigmoid function is then applied to the sum.\n"
          s += "> ------------------------------\n"
          s += "\n\t+\n".join(
              [self._tree_to_str(t) for t in self.trees_]
          )
          if (
              hasattr(self, "feature_names_")
              and self.feature_names_ is not None
          ):
              for i in range(len(self.feature_names_))[::-1]:
                  s = s.replace(f"X_{i}", self.feature_names_[i])
          return s
  
imports: from copy import deepcopy
  from typing import List
  import matplotlib.pyplot
  import numpy
  import pandas
  from scipy.special import expit
  from sklearn import datasets
  from sklearn import tree
  from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
  from sklearn.model_selection import train_test_split, cross_val_score
  from sklearn.tree import plot_tree, DecisionTreeClassifier
  from sklearn.utils import check_X_y, check_array
  from sklearn.utils.validation import _check_sample_weight, check_is_fitted
  from imodels.tree.viz_utils import extract_sklearn_tree_from_figs
  from imodels.util.arguments import check_fit_arguments
  from imodels.util.data_util import encode_categories
label_desc: Use image node_id 8 for calling the FIGS obj's underlying member method code with example usage: obj.__str__() and returns: s, s