code: def test_extraValue(self):
      train = pd.DataFrame(
          {"city": ["chicago", "st louis", "chicago", "st louis"]}
      )
      test = pd.DataFrame({"city": ["chicago", "los angeles"]})
      enc = encoders.RankHotEncoder(handle_unknown="value")
      train_out = enc.fit_transform(train)
      expected_mapping = pd.DataFrame(
          [
              [1, 0],
              [1, 1],
          ],
          columns=["city_1", "city_2"],
          index=[1, 2],
      )
      expected_out_train = pd.DataFrame(
          [
              [1, 0],
              [1, 1],
              [1, 0],
              [1, 1],
          ],
          columns=["city_1", "city_2"],
      )
      expected_out_test = pd.DataFrame(
          [
              [1, 0],
              [0, 0],
          ],
          columns=["city_1", "city_2"],
      )
      pd.testing.assert_frame_equal(train_out, expected_out_train)
      pd.testing.assert_frame_equal(
          enc.mapping[0]["mapping"], expected_mapping, check_dtype=False
      )
      t_f = enc.transform(test)
      pd.testing.assert_frame_equal(t_f, expected_out_test)
      inv_tf = enc.inverse_transform(t_f)
      expected_inverse_test = pd.DataFrame(
          {"city": ["chicago", np.nan]}
      )
      th.verify_inverse_transform(expected_inverse_test, inv_tf)
  
file_path: category_encoders/tests/test_rankhot.py
imports: import pandas
  from unittest import TestCase
  import tests.helpers
  import numpy
  import category_encoders
label_desc: Use image node_id 4 for calling the TestRankHotEncoder obj's underlying member method code with example usage: obj.test_extraValue() without return types