code: def test_transform_with_new_and_missing_values(self):
      # training data
      d = {"col1": ["a", "a", "c"]}
      y = [1, 1, 1]
      df = pd.DataFrame(data=d)
      # fit encoder
      le = LooEncoder(cols=["col1"])
      le.fit(df, y)
      # test data
      d_test = {"col1": ["c", "a", "d", "f", np.nan]}
      df_test = pd.DataFrame(data=d_test)
      # transform
      t = le.transform(df_test)
      assert_almost_equal(t["col1"][2], 1)
      assert_almost_equal(t["col1"][3], 1)
      assert_almost_equal(t["col1"][4], 1)
  
file_path: mljar-supervised/tests/tests_preprocessing/test_loo_encoder.py
imports: import unittest
  import tempfile
  import json
  import numpy
  import pandas
  from numpy.testing import assert_almost_equal
  from supervised.preprocessing.loo_encoder import LooEncoder
label_desc: Use image node_id 3 for calling the LabelEncoderTest obj's underlying member method code with example usage: obj.test_transform_with_new_and_missing_values() without return types