docstr: Combine small categories into a single category.
docstr_tok: ["Combine","small","categories","into","a","single","category","."]
code: def combine_min_categories(self, X):
      """Combine small categories into a single category."""
      for col, mapper in self.mapping.items():
          if self._normalize[col] and isinstance(
              self._min_group_size[col], int
          ):
              self._min_group_size[col] = (
                  self._min_group_size[col] / X.shape[0]
              )
          elif not self._normalize and isinstance(
              self._min_group_size[col], float
          ):
              self._min_group_size[col] = (
                  self._min_group_size[col] * X.shape[0]
              )
  
          if self._combine_min_nan_groups[col] is True:
              min_groups_idx = mapper < self._min_group_size[col]
          elif self._combine_min_nan_groups[col] == "force":
              min_groups_idx = (mapper < self._min_group_size[col]) | (
                  mapper.index.isna()
              )
          else:
              min_groups_idx = (mapper < self._min_group_size[col]) & (
                  ~mapper.index.isna()
              )
  
          min_groups_sum = mapper.loc[min_groups_idx].sum()
  
          if (
              min_groups_sum > 0
              and min_groups_idx.sum() > 1
              and not min_groups_idx.loc[
                  ~min_groups_idx.index.isna()
              ].all()
          ):
              if isinstance(self._min_group_name[col], str):
                  min_group_mapper_name = self._min_group_name[col]
              else:
                  min_group_mapper_name = "_".join(
                      [
                          str(idx)
                          for idx in mapper.loc[min_groups_idx]
                          .index.astype(str)
                          .sort_values()
                      ]
                  )
  
              self._min_group_categories[col] = {
                  cat: min_group_mapper_name
                  for cat in mapper.loc[min_groups_idx].index.tolist()
              }
  
              if not min_groups_idx.all():
                  mapper = mapper.loc[~min_groups_idx]
                  mapper[min_group_mapper_name] = min_groups_sum
  
              self.mapping[col] = mapper
  
file_path: category_encoders/category_encoders/count.py
imports: import numpy
  import pandas
  import category_encoders.utils
  from category_encoders.ordinal import OrdinalEncoder
  from copy import copy
label_desc: Use image node_id 5 for calling the CountEncoder obj's underlying member method code with example usage: obj.combine_min_categories(X) without return types