class_docstr: Encodes rare categories into an "other" parameter.
  
  Note that this encoder assumes data is received as a DataFrame.
  
  Parameters
  ----------
  max_num_categories : int , default: 10
      Indicates the maximum number of unique categories in a single categorical column
      (rare categories will be changed to a form of "other")
  cols : Optional[List[Hashable]] , default: None
      Columns to limit the encoder to work on. If non are given will work on all columns given in `fit`
class_docstr_tok: ["Encodes","rare","categories","into","an","``","other","''","parameter",".","Note","that","this","encoder","assumes","data","is","received","as","a","DataFrame",".","Parameters","--","--","--","--","--","max_num_categories",":","int",",","default",":","10","Indicates","the","maximum","number","of","unique","categories","in","a","single","categorical","column","(","rare","categories","will","be","changed","to","a","form","of","``","other","''",")","cols",":","Optional","[","List","[","Hashable","]","]",",","default",":","None","Columns","to","limit","the","encoder","to","work","on",".","If","non","are","given","will","work","on","all","columns","given","in","`","fit","`"]
docstr: Fit the encoder using given dataframe.
  
  Parameters
  ----------
  data : pd.DataFrame
      data to fit from
  y :
      Unused, but needed for sklearn pipeline
docstr_tok: ["Fit","the","encoder","using","given","dataframe",".","Parameters","--","--","--","--","--","data",":","pd.DataFrame","data","to","fit","from","y",":","Unused",",","but","needed","for","sklearn","pipeline"]
code: def fit(
      self, data: pd.DataFrame, y=None
  ):  # noqa # pylint: disable=unused-argument
      """Fit the encoder using given dataframe.
  
      Parameters
      ----------
      data : pd.DataFrame
          data to fit from
      y :
          Unused, but needed for sklearn pipeline
      """
      self._col_mapping = {}
  
      if self.cols is not None:
          for col in self.cols:
              self._col_mapping[col] = self._fit_for_series(data[col])
      else:
          for col in data.columns:
              self._col_mapping[col] = self._fit_for_series(data[col])
  
file_path: deepchecks/deepchecks/utils/distribution/rare_category_encoder.py
imports: from collections import defaultdict
  from typing import List, Optional
  import pandas
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 2 for calling the RareCategoryEncoder obj's underlying member method code with example usage: obj.fit(data, y) without return types