code: def test_fit_and_transform_binary(self):
      # >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
      # Test binary features with no categorical or ordinal features.
      # >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
      fbt = FeatureBinarizerFromTrees(
          treeNum=1, treeDepth=1, randomState=self.random_state
      )
      fbt.fit(self.X_train[self.col_binary], self.y_train)
      self.assertListEqual(list(fbt.maps.keys()), ["bin alpha"])
      temp = [("bin alpha", "", ""), ("bin alpha", "not", "")]
      self.assertListEqual(fbt.features.to_list(), temp)
  
      # Transform
      T = fbt.transform(self.X_test)
      self.assertListEqual(T.columns.to_list(), temp)
  
      # Now test taking all available features.
      fbt = FeatureBinarizerFromTrees(
          treeNum=1, treeDepth=None, randomState=self.random_state
      )
      fbt.fit(self.X_train[self.col_binary], self.y_train)
      self.assertListEqual(list(fbt.maps.keys()), self.col_binary)
      temp = [
          ("bin alpha", "", ""),
          ("bin alpha", "not", ""),
          ("bin num", "", ""),
          ("bin num", "not", ""),
      ]
      self.assertListEqual(fbt.features.to_list(), temp)
  
      # Transform
      T = fbt.transform(self.X_test)
      self.assertListEqual(fbt.features.to_list(), temp)
      a = T[("bin num", "", "")].to_numpy()
      b = (self.X_test["bin num"] == 1).astype(int).to_numpy()
      self.assertTrue(np.all(a == b))
      a = T[("bin num", "not", "")].to_numpy()
      b = 1 - b
      self.assertTrue(np.all(a == b))
      a = T[("bin alpha", "", "")].to_numpy()
      b = (self.X_test["bin alpha"] == "b").astype(int).to_numpy()
      self.assertTrue(np.all(a == b))
      a = T[("bin alpha", "not", "")].to_numpy()
      b = 1 - b
      self.assertTrue(np.all(a == b))
  
file_path: AIX360/tests/rbm/test_Feature_Binarizer_From_Trees.py
imports: from unittest import TestCase
  import numpy
  from numpy import ndarray
  from pandas import DataFrame
  from sklearn.datasets import load_breast_cancer
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import OneHotEncoder, StandardScaler
  from aix360.algorithms.rbm import FeatureBinarizerFromTrees
label_desc: Use image node_id 4 for calling the TestFeatureBinarizerFromTrees obj's underlying member method code with example usage: obj.test_fit_and_transform_binary() without return types