code: def test_targetencoder_customized_fold_id():
      """
      use customized `fold_ids` array to split data.
      in this example, the 1st sample belongs to `fold 0`
      the 2nd and 3rd sample belongs to `fold 1`
      and the 4th sample belongs to `fold 2`
      """
      train = cudf.DataFrame(
          {"category": ["a", "b", "b", "a"], "label": [1, 0, 1, 1]}
      )
      fold_ids = [0, 1, 1, 2]
      encoder = TargetEncoder(split_method="customize")
      train_encoded = encoder.fit_transform(
          train.category, train.label, fold_ids=fold_ids
      )
      answer = np.array([1.0, 0.75, 0.75, 1.0])
      assert array_equal(train_encoded, answer)
  
      encoder = TargetEncoder(split_method="customize")
      encoder.fit(train.category, train.label, fold_ids=fold_ids)
      train_encoded = encoder.transform(train.category)
  
      assert array_equal(train_encoded, 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 11 for calling a global function with example usage: test_targetencoder_customized_fold_id() without return types