code: def test_targetencoder_smooth():
      train = cudf.DataFrame(
          {"category": ["a", "b", "b", "a"], "label": [1, 0, 1, 1]}
      )
      answers = np.array(
          [
              [1.0, 1.0, 0.0, 1.0],
              [0.875, 0.875, 0.375, 0.875],
              [0.8333, 0.8333, 0.5, 0.8333],
              [0.75, 0.75, 0.75, 0.75],
          ]
      )
      smooths = [0, 1, 2, 10000]
      for smooth, answer in zip(smooths, answers):
          encoder = TargetEncoder(smooth=smooth)
          train_encoded = encoder.fit_transform(
              train.category, train.label
          )
          assert array_equal(train_encoded, answer)
  
          encoder = TargetEncoder(smooth=smooth)
          encoder.fit(train.category, train.label)
          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 10 for calling a global function with example usage: test_targetencoder_smooth() without return types