code: def test_fit_and_transform_ordinal(self):
      # >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
      # Test ordinal with no categorical or binary features.
      # >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
  
      fbt = FeatureBinarizerFromTrees(
          treeNum=1, treeDepth=1, randomState=self.random_state
      )
      fbt.fit(self.X_train[self.col_ordinal], self.y_train)
      temp = [
          ("mean concave points", "<=", 0.04892),
          ("mean concave points", ">", 0.04892),
      ]
      self.assertListEqual(fbt.features.to_list(), temp)
      self.assertDictEqual(
          fbt.thresh, {"mean concave points": np.array([0.04892])}
      )
  
      # Transform
      T = fbt.transform(self.X_test)
      self.assertListEqual(T.columns.to_list(), temp)
  
      # Test threshStr
      fbt = FeatureBinarizerFromTrees(
          treeNum=1,
          treeDepth=1,
          randomState=self.random_state,
          threshStr=True,
      )
      fbt.fit(self.X_train[self.col_ordinal], self.y_train)
      self.assertDictEqual(
          fbt.thresh, {"mean concave points": np.array([0.04892])}
      )
  
      # Transform
      T = fbt.transform(self.X_test)
      temp = [
          ("mean concave points", "<=", "0.04892"),
          ("mean concave points", ">", "0.04892"),
      ]
      self.assertListEqual(T.columns.to_list(), temp)
  
      # Test threshRound
      fbt = FeatureBinarizerFromTrees(
          treeNum=1,
          treeDepth=1,
          threshRound=2,
          randomState=self.random_state,
      )
      fbt.fit(self.X_train[self.col_ordinal], self.y_train)
      temp = [
          ("mean concave points", "<=", 0.05),
          ("mean concave points", ">", 0.05),
      ]
      self.assertListEqual(fbt.features.to_list(), temp)
      self.assertDictEqual(
          fbt.thresh, {"mean concave points": np.array([0.05])}
      )
  
      # Now test taking all available features.
      fbt = FeatureBinarizerFromTrees(
          treeNum=1, treeDepth=None, randomState=self.random_state
      )
      fbt.fit(self.X_train[self.col_ordinal], self.y_train)
  
      temp = {
          "area error": np.array([46.315001]),
          "concavity error": np.array([0.016965]),
          "mean area": np.array([995.5]),
          "mean concave points": np.array([0.04892]),
          "mean texture": np.array([19.9]),
          "smoothness error": np.array([0.003299, 0.005083]),
          "texture error": np.array([0.51965]),
          "worst area": np.array([785.799988]),
          "worst compactness": np.array([0.4508]),
          "worst concavity": np.array([0.3655]),
          "worst texture": np.array([23.47, 32.779999, 33.805]),
      }
  
      for k, v in fbt.thresh.items():
          self.assertTrue(np.all(temp[k] == v))
  
      temp = [
          ("area error", "<=", 46.315001),
          ("area error", ">", 46.315001),
          ("concavity error", "<=", 0.016965),
          ("concavity error", ">", 0.016965),
          ("mean area", "<=", 995.5),
          ("mean area", ">", 995.5),
          ("mean concave points", "<=", 0.04892),
          ("mean concave points", ">", 0.04892),
          ("mean texture", "<=", 19.9),
          ("mean texture", ">", 19.9),
          ("smoothness error", "<=", 0.003299),
          ("smoothness error", "<=", 0.005083),
          ("smoothness error", ">", 0.003299),
          ("smoothness error", ">", 0.005083),
          ("texture error", "<=", 0.51965),
          ("texture error", ">", 0.51965),
          ("worst area", "<=", 785.799988),
          ("worst area", ">", 785.799988),
          ("worst compactness", "<=", 0.4508),
          ("worst compactness", ">", 0.4508),
          ("worst concavity", "<=", 0.3655),
          ("worst concavity", ">", 0.3655),
          ("worst texture", "<=", 23.47),
          ("worst texture", "<=", 32.779999),
          ("worst texture", "<=", 33.805),
          ("worst texture", ">", 23.47),
          ("worst texture", ">", 32.779999),
          ("worst texture", ">", 33.805),
      ]
  
      self.assertListEqual(fbt.features.to_list(), temp)
  
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 6 for calling the TestFeatureBinarizerFromTrees obj's underlying member method code with example usage: obj.test_fit_and_transform_ordinal() without return types