code: def test_hierarchy_columnwise_compass(self):
      X, y = load_compass()
      cols = X.columns[~X.columns.str.startswith("HIER")]
      HIER_cols = X.columns[X.columns.str.startswith("HIER")]
      enc = encoders.TargetEncoder(
          verbose=1,
          smoothing=2,
          min_samples_leaf=2,
          hierarchy=X[HIER_cols],
          cols=["compass"],
      )
      result = enc.fit_transform(X[cols], y)
  
      values = result["compass"].array
      self.assertAlmostEqual(0.6226, values[0], delta=1e-4)
      self.assertAlmostEqual(0.9038, values[2], delta=1e-4)
      self.assertAlmostEqual(0.1766, values[5], delta=1e-4)
      self.assertAlmostEqual(0.4605, values[7], delta=1e-4)
      self.assertAlmostEqual(0.4033, values[11], 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 18 for calling the TestTargetEncoder obj's underlying member method code with example usage: obj.test_hierarchy_columnwise_compass() without return types