code: def test_targetencoder_multi_column():
      """
      Test jointly encoding multiple columns
      """
      train = cudf.DataFrame(
          {
              "cat_1": ["a", "b", "b", "a", "a", "b"],
              "cat_2": [1, 1, 2, 2, 1, 2],
              "label": [1, 0, 1, 1, 0, 1],
          }
      )
      test = cudf.DataFrame(
          {"cat_1": ["b", "b", "a", "b"], "cat_2": [1, 2, 1, 2]}
      )
      encoder = TargetEncoder()
      train_encoded = encoder.fit_transform(
          train[["cat_1", "cat_2"]], train.label
      )
      test_encoded = encoder.transform(test[["cat_1", "cat_2"]])
      train_answer = np.array(
          [2.0 / 3, 2.0 / 3, 1.0, 2.0 / 3, 2.0 / 3, 1.0]
      )
      test_answer = np.array([0.0, 1.0, 0.5, 1.0])
      assert array_equal(train_encoded, train_answer)
      assert array_equal(test_encoded, test_answer)
  
      encoder = TargetEncoder()
      encoder.fit(train[["cat_1", "cat_2"]], train.label)
      train_encoded = encoder.transform(train[["cat_1", "cat_2"]])
      test_encoded = encoder.transform(test[["cat_1", "cat_2"]])
      assert array_equal(train_encoded, train_answer)
      assert array_equal(test_encoded, test_answer)
  
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 4 for calling a global function with example usage: test_targetencoder_multi_column() without return types