docs: def fit_transform(self, X, y):
          """Encode categorical columns into average target values.
          Args:
              X (pandas.DataFrame): categorical columns to encode
              y (pandas.Series): the target column
          Returns:
              X (pandas.DataFrame): encoded columns
          """
          self.target_encoders = [None] * X.shape[1]
          self.target_mean = y.mean()
  
          for i, col in enumerate(X.columns):
              self.target_encoders[i] = self._get_target_encoder(X[col], y)
  
              X.loc[:, col] = X[col].fillna(NAN_INT).map(self.target_encoders[i]).fillna(self.target_mean)
  
          return X