docstr: Encode given columns of X according to y, and transform X based on the learnt mapping.
  
  :param pandas.DataFrame X: DataFrame of features, shape (n_samples, n_features). Must contain columns to encode.
  :param pandas.Series y: pandas Series of target values, shape (n_samples,).
      Required only for encoders that need it: TargetEncoder, WeightOfEvidenceEncoder
  :return: encoded DataFrame of shape (n_samples, n_features), initial categorical columns are dropped, and
      replaced with encoded columns. DataFrame passed in argument is unchanged.
  :rtype: pandas.DataFrame
docstr_tok: ["Encode","given","columns","of","X","according","to","y",",","and","transform","X","based","on","the","learnt","mapping",".",":","param","pandas.DataFrame","X",":","DataFrame","of","features",",","shape","(","n_samples",",","n_features",")",".","Must","contain","columns","to","encode",".",":","param","pandas.Series","y",":","pandas","Series","of","target","values",",","shape","(","n_samples",",",")",".","Required","only","for","encoders","that","need","it",":","TargetEncoder",",","WeightOfEvidenceEncoder",":","return",":","encoded","DataFrame","of","shape","(","n_samples",",","n_features",")",",","initial","categorical","columns","are","dropped",",","and","replaced","with","encoded","columns",".","DataFrame","passed","in","argument","is","unchanged",".",":","rtype",":","pandas.DataFrame"]
code: def fit_transform(self, X, y=None):
      """Encode given columns of X according to y, and transform X based on the learnt mapping.
  
      :param pandas.DataFrame X: DataFrame of features, shape (n_samples, n_features). Must contain columns to encode.
      :param pandas.Series y: pandas Series of target values, shape (n_samples,).
          Required only for encoders that need it: TargetEncoder, WeightOfEvidenceEncoder
      :return: encoded DataFrame of shape (n_samples, n_features), initial categorical columns are dropped, and
          replaced with encoded columns. DataFrame passed in argument is unchanged.
      :rtype: pandas.DataFrame
      """
      self.fit(X, y)
      return self.transform(X)
  
imports: from pandas import DataFrame, Series, unique
  import numpy
  from rich.progress import track
  from sklearn.base import BaseEstimator, TransformerMixin
  from pytorch_tabular.utils import get_logger
label_desc: Use image node_id 3 for calling the BaseEncoder obj's underlying member method code with example usage: obj.fit_transform(X, y) and returns: self