class_docstr: FrequencyEncoder
  Conversion of category into frequencies.
  Parameters
      ----------
  cols : list of categorical features.
  drop_invariant : not used
docstr: Description of fit
  
  Args:
      X (pd.DataFrame): dataset
      y=None (not used): not used
  
  Returns:
      pd.DataFrame
docstr_tok: ["Description","of","fit","Args",":","X","(","pd.DataFrame",")",":","dataset","y=None","(","not","used",")",":","not","used","Returns",":","pd.DataFrame"]
code: def fit(self, X: pd.DataFrame, y=None) -> pd.DataFrame:
      """
      Description of fit
  
      Args:
          X (pd.DataFrame): dataset
          y=None (not used): not used
  
      Returns:
          pd.DataFrame
  
      """
      counts_dict = {}
      if self.cols is None:
          self.cols = X.columns
      for col in self.cols:
          values = X[col].value_counts(dropna=False).index
          n_obs = np.float(len(X))
          counts = list(X[col].value_counts(dropna=False) / n_obs)
          counts_dict[col] = dict(zip(values, counts))
      self.counts_dict = counts_dict
  
imports: import pandas
  import numpy
label_desc: Use image node_id 2 for calling the FrequencyEncoder obj's underlying member method code with example usage: obj.fit(X, y) without return types