code: def test_transform_with_coalescence(self):
      # Generates an array with categories 0, 20, 5, 6, 10, and occurences of 60%,
      # 30%, 19% 0.5% and 0.5% respectively
      X = np.vstack(
          (
              np.ones((120, 10)) * 0,
              np.ones((60, 10)) * 20,
              np.ones((18, 10)) * 5,
              np.ones((1, 10)) * 6,
              np.ones((1, 10)) * 10,
          )
      )
      for col in range(X.shape[1]):
          np.random.shuffle(X[:, col])
  
      CPPL = CategoricalPreprocessingPipeline()
      Y1t = CPPL.fit_transform(X)
      # From the 5 original categories, 2 are coalesced, remaining 4.
      # Dataset has 10 cols, therefore Y must have 40 (i.e. 4 x 10) cols
      self.assertEqual(Y1t.shape, (200, 40))
      # Consistency check:
      Y2t = CPPL.transform(X)
      np.testing.assert_array_equal(Y1t, Y2t)
  
file_path: auto-sklearn/test/test_pipeline/components/data_preprocessing/test_data_preprocessing_categorical.py
imports: import numpy
  from scipy import sparse
  from autosklearn.pipeline.components.data_preprocessing.feature_type_categorical import CategoricalPreprocessingPipeline
  import pytest
  import unittest
label_desc: Use image node_id 4 for calling the CategoricalPreprocessingPipelineTest obj's underlying member method code with example usage: obj.test_transform_with_coalescence() without return types