code: def test_ordinal(self):
      enc = encoders.OrdinalEncoder(verbose=1, return_df=True)
      enc.fit(X)
      out = enc.transform(X_t)
      self.assertEqual(len(set(out["extra"].values)), 4)
      self.assertIn(-1, set(out["extra"].values))
      self.assertFalse(enc.mapping is None)
      self.assertTrue(len(enc.mapping) > 0)
  
      enc = encoders.OrdinalEncoder(
          verbose=1, mapping=enc.mapping, return_df=True
      )
      enc.fit(X)
      out = enc.transform(X_t)
      self.assertEqual(len(set(out["extra"].values)), 4)
      self.assertIn(-1, set(out["extra"].values))
      self.assertTrue(len(enc.mapping) > 0)
  
      enc = encoders.OrdinalEncoder(
          verbose=1, return_df=True, handle_unknown="return_nan"
      )
      enc.fit(X)
      out = enc.transform(X_t)
      out_cats = [x for x in set(out["extra"].values) if np.isfinite(x)]
      self.assertEqual(len(out_cats), 3)
      self.assertFalse(enc.mapping is None)
  
imports: import pandas
  from unittest import TestCase
  import tests.helpers
  import numpy
  import category_encoders
label_desc: Use image node_id 1 for calling the TestOrdinalEncoder obj's underlying member method code with example usage: obj.test_ordinal() without return types