code: def test_hierarchy_single_mapping(self):
      enc = encoders.TargetEncoder(
          verbose=1,
          smoothing=2,
          min_samples_leaf=2,
          hierarchy=self.hierarchical_map,
          cols=["Plant"],
      )
      result = enc.fit_transform(
          self.hierarchical_cat_example,
          self.hierarchical_cat_example["target"],
      )
  
      values = result["Plant"].array
      self.assertAlmostEqual(0.6828, values[0], delta=1e-4)
      self.assertAlmostEqual(0.5, values[4], delta=1e-4)
      self.assertAlmostEqual(0.5, values[8], delta=1e-4)
      self.assertAlmostEqual(0.3172, values[12], delta=1e-4)
  
imports: import pandas
  from unittest import TestCase
  import tests.helpers
  import numpy
  from category_encoders.datasets import load_postcodes, load_compass
  import category_encoders
label_desc: Use image node_id 13 for calling the TestTargetEncoder obj's underlying member method code with example usage: obj.test_hierarchy_single_mapping() without return types