code: def test_targetencoder_numpy():
      """
      Note that there are newly-encountered values in x_test,
      namely, 3 and 4.
      """
      x_train = np.array([1, 2, 2, 1])
      y_train = np.array([1, 0, 1, 1])
      x_test = np.array([1, 2, 3, 4])
      encoder = TargetEncoder()
      encoder.fit_transform(x_train, y_train)
      test_encoded = encoder.transform(x_test)
      answer = np.array([1.0, 0.5, 0.75, 0.75])
      assert array_equal(test_encoded, answer)
      print(type(test_encoded))
      assert isinstance(test_encoded, np.ndarray)
  
file_path: cuml/python/cuml/tests/test_target_encoder.py
imports: import pytest
  from cuml.testing.utils import array_equal
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.preprocessing.TargetEncoder import TargetEncoder
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 8 for calling a global function with example usage: test_targetencoder_numpy() without return types