code: def test_encode_nominal(self):
      mock_int_encoder = LabelEncoder()
      mock_int_encoder.classes_ = [1, 3]
      mock_str_encoder = LabelEncoder()
      mock_str_encoder.classes_ = ["foo", "bar"]
      label_encoders = {
          "int_col": mock_int_encoder,
          "str_col": mock_str_encoder,
      }
      actual_df = create_test_df()
      base.encode_nominal(label_encoders, actual_df)
  
      expected_df = pd.DataFrame(
          {
              "int_col": [0, base.DEFAULT_ENCODING_VALUE],
              "float_col": [1.2, 4.5],
              "str_col": [0, 1],
          }
      )
      self.assertTrue(actual_df.equals(expected_df))
  
file_path: AIX360/tests/rule_induction/ripper/test_base.py
imports: from unittest import TestCase
  from sklearn.preprocessing import LabelEncoder
  import pandas
  from aix360.algorithms.rule_induction.ripper import base
label_desc: Use image node_id 2 for calling the TestBase obj's underlying member method code with example usage: obj.test_encode_nominal() without return types