code: def fbt_vs_fb(
      X,
      y,
      categorical=[],
      iterations=30,
      treeNum=1,
      treeDepth=4,
      numThresh=9,
      filename=None,
  ):
      def fit_transform(transformer, args_train, args_test):
          X_train_fb, X_train_std_fb = transformer.fit_transform(
              *args_train
          )
          X_test_fb, X_test_std_fb = transformer.transform(*args_test)
          return X_train_fb, X_train_std_fb, X_test_fb, X_test_std_fb
  
      def fit_score(explainer, y_test, args_train, args_test):
          t = time()
          explainer.fit(*args_train)
          t = time() - t
          y_pred = explainer.predict(*args_test)
          if isinstance(explainer, BRCGExplainer):
              z: DataFrame = explainer._model.z.loc[
                  :, explainer._model.w > 0.5
              ]
              rules = z.shape[1]
              clauses = z.any(axis=1).sum()
          else:
              z: DataFrame = explainer._model.z
              rules = z.any(axis=1).sum()
              clauses = z.any(axis=1).sum() + 1  # +1 for intercept
          return (
              t,
              accuracy_score(y_test, y_pred),
              precision_score(y_test, y_pred),
              recall_score(y_test, y_pred),
              f1_score(y_test, y_pred),
              rules,
              clauses,
              str(explainer.explain()),
          )
  
      columns = [
          "time",
          "accuracy",
          "precision",
          "recall",
          "f1",
          "rules",
          "clauses",
      ]
      index = pd.MultiIndex.from_product(
          (["brcg", "logrr"], ["fb", "fbt"], range(iterations))
      )
      d = DataFrame(
          np.zeros((iterations * 4, len(columns))),
          dtype=float,
          index=index,
          columns=columns,
      )
      d["explanation"] = ""
  
      fb = FeatureBinarizer(
          colCateg=categorical,
          negations=True,
          returnOrd=True,
          numThresh=numThresh,
      )
      fbt = FeatureBinarizerFromTrees(
          colCateg=categorical,
          treeNum=treeNum,
          treeDepth=treeDepth,
          returnOrd=True,
      )
  
      brcg = BRCGExplainer(BooleanRuleCG(silent=True))
      logrr = GLRMExplainer(
          LogisticRuleRegression(
              lambda0=0.005,
              lambda1=0.001,
              useOrd=True,
              maxSolverIter=1000,
          )
      )
  
      for i in range(iterations):
          # Train/Test split
          X_train, X_test, y_train, y_test = train_test_split(
              X, y, stratify=y, random_state=i
          )
  
          # FeatureBinarizer
          (
              X_train_fb,
              X_train_std_fb,
              X_test_fb,
              X_test_std_fb,
          ) = fit_transform(fb, (X_train,), (X_test,))
          d.loc[("brcg", "fb", i)] = fit_score(
              brcg, y_test, (X_train_fb, y_train), (X_test_fb,)
          )
          d.loc[("logrr", "fb", i)] = fit_score(
              logrr,
              y_test,
              (X_train_fb, y_train, X_train_std_fb),
              (X_test_fb, X_test_std_fb),
          )
  
          # FeatureBinarizerFromTrees
          (
              X_train_fb,
              X_train_std_fb,
              X_test_fb,
              X_test_std_fb,
          ) = fit_transform(fbt, (X_train, y_train), (X_test,))
          d.loc[("brcg", "fbt", i)] = fit_score(
              brcg, y_test, (X_train_fb, y_train), (X_test_fb,)
          )
          d.loc[("logrr", "fbt", i)] = fit_score(
              logrr,
              y_test,
              (X_train_fb, y_train, X_train_std_fb),
              (X_test_fb, X_test_std_fb),
          )
  
      if filename is not None:
          with open(filename, "wb") as fl:
              pickle.dump(d, fl)
  
      return d
  
imports: import warnings
  import pickle
  from time import time
  import numpy
  import pandas
  import shap
  from aix360.algorithms.rbm import BooleanRuleCG, BRCGExplainer, FeatureBinarizer, FeatureBinarizerFromTrees, GLRMExplainer, LogisticRuleRegression
  from aix360.datasets import HELOCDataset, MEPSDataset
  from aix360.datasets.heloc_dataset import nan_preprocessing
  from pandas import DataFrame
  from sklearn.datasets import load_breast_cancer
  from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score
  from sklearn.model_selection import train_test_split
label_desc: Use image node_id 1 for calling a global function with example usage: fbt_vs_fb(X, y, categorical, iterations, treeNum, treeDepth, numThresh, filename) and returns: d, X_train_fb,  X_train_std_fb,  X_test_fb,  X_test_std_fb, t,  accuracy_score,  precision_score,  recall_score,  f1_score,  rules,  clauses,  str