docstr: Test on a real (small) dataset
          
docstr_tok: ["Test","on","a","real","(","small",")","dataset"]
code: def test_fitting(self):
      """Test on a real (small) dataset"""
      for model_type in [
          FIGSClassifier,
          FIGSRegressor,
          FIGSExtClassifier,
          FIGSExtRegressor,
          FIGSClassifierCV,
          FIGSRegressorCV,
          partial(
              BaggingClassifier,
              base_estimator=FIGSExtClassifier(max_rules=3),
              n_estimators=2,
          ),
      ]:
          init_kwargs = {}
          m = model_type(**init_kwargs)
  
          X = self.X
          m.fit(X, self.y_classification_binary)
  
          # test predict()
          preds = m.predict(X)  # > 0.5).astype(int)
          assert preds.size == self.n, "predict() yields right size"
  
          # test preds_proba()
          if model_type in [
              FIGSClassifier,
              FIGSClassifierCV,
              BaggingClassifier,
          ]:
              preds_proba = m.predict_proba(X)
              assert (
                  len(preds_proba.shape) == 2
              ), "preds_proba has 2 columns"
              assert (
                  preds_proba.shape[1] == 2
              ), "preds_proba has 2 columns"
              assert (
                  np.max(preds_proba) < 1.1
              ), "preds_proba has no values over 1"
              assert (np.argmax(preds_proba, axis=1) == preds).all(), (
                  "predict_proba and " "predict correspond"
              )
  
          # test acc
          acc_train = np.mean(preds == self.y_classification_binary)
          assert acc_train > 0.8, "acc greater than 0.9"
          # print(m)
  
          if not type(m) in [
              FIGSClassifierCV,
              FIGSRegressorCV,
              BaggingClassifier,
          ]:
              trees = m.trees_
              assert len(trees) == 1, "only one tree"
              assert trees[0].feature == 1, "split on feat 1"
              assert np.abs(trees[0].left.value) < 0.01, "left value 0"
              assert (
                  trees[0].left.left is None
                  and trees[0].left.right is None
              ), "left is leaf"
              assert (
                  np.abs(trees[0].right.left.value) < 0.01
              ), "right-left value 0"
              assert (
                  np.abs(trees[0].right.right.value - 1) < 0.01
              ), "right-right value 1"
  
file_path: imodels/tests/figs_test.py
imports: import os
  import random
  from functools import partial
  import numpy
  import pandas
  from sklearn.tree import DecisionTreeRegressor
  from imodels import FIGSClassifier, FIGSRegressor, FIGSClassifierCV, FIGSRegressorCV
  from imodels.experimental.figs_ensembles import FIGSExtRegressor, FIGSExtClassifier
  from sklearn.ensemble import StackingRegressor, VotingRegressor, BaggingClassifier
label_desc: Use image node_id 4 for calling the TestFIGS obj's underlying member method code with example usage: obj.test_fitting() without return types