docstr: Learn the values that should be used to replace outliers.
  
  Parameters
  ----------
  X : pandas dataframe of shape = [n_samples, n_features]
      The training input samples.
  
  y : pandas Series, default=None
      y is not needed in this transformer. You can pass y or None.
docstr_tok: ["Learn","the","values","that","should","be","used","to","replace","outliers",".","Parameters","--","--","--","--","--","X",":","pandas","dataframe","of","shape","=","[","n_samples",",","n_features","]","The","training","input","samples",".","y",":","pandas","Series",",","default=None","y","is","not","needed","in","this","transformer",".","You","can","pass","y","or","None","."]
code: def fit(self, X: pd.DataFrame, y: Optional[pd.Series] = None):
      """
      Learn the values that should be used to replace outliers.
  
      Parameters
      ----------
      X : pandas dataframe of shape = [n_samples, n_features]
          The training input samples.
  
      y : pandas Series, default=None
          y is not needed in this transformer. You can pass y or None.
      """
  
      # check input dataframe
      X = check_X(X)
  
      # find or check for numerical variables
      self.variables_ = _find_or_check_numerical_variables(
          X, self.variables
      )
  
      if self.missing_values == "raise":
          # check if dataset contains na
          _check_contains_na(X, self.variables_)
          _check_contains_inf(X, self.variables_)
  
      self.right_tail_caps_ = {}
      self.left_tail_caps_ = {}
  
      if self.capping_method == "gaussian":
          bias = X[self.variables_].mean()
          scale = X[self.variables_].std(ddof=0)
      elif self.capping_method == "iqr":
          bias = X[self.variables_].quantile((0.75, 0.25))
          scale = bias.loc[0.75] - bias.loc[0.25]
      elif self.capping_method == "quantiles":
          bias = X[self.variables_].quantile((1 - self.fold, self.fold))
          scale = bias.loc[1 - self.fold] - bias.loc[self.fold]
      elif self.capping_method == "mad":
          bias = X[self.variables_].median()
          # scaling factor for normal distribution
          scale = (X[self.variables_] - bias).abs().median() / 0.67449
      if (scale == 0).any():
          raise ValueError(
              f"Input columns {scale[scale == 0].index.tolist()!r}"
              f" have low variation for method {self.capping_method!r}."
              f" Try other capping methods or drop these columns."
          )
  
      # estimate the end values
      if self.tail in ["right", "both"]:
          if self.capping_method in ("gaussian", "mad"):
              self.right_tail_caps_ = (
                  bias + self.fold * scale
              ).to_dict()
  
          elif self.capping_method == "iqr":
              self.right_tail_caps_ = (
                  bias.loc[0.75] + self.fold * scale
              ).to_dict()
  
          elif self.capping_method == "quantiles":
              self.right_tail_caps_ = bias.loc[1 - self.fold].to_dict()
  
      if self.tail in ["left", "both"]:
          if self.capping_method in ("gaussian", "mad"):
              self.left_tail_caps_ = (
                  bias - self.fold * scale
              ).to_dict()
  
          elif self.capping_method == "iqr":
              self.left_tail_caps_ = (
                  bias.loc[0.25] - self.fold * scale
              ).to_dict()
  
          elif self.capping_method == "quantiles":
              self.left_tail_caps_ = bias.loc[self.fold].to_dict()
  
      self.feature_names_in_ = X.columns.to_list()
      self.n_features_in_ = X.shape[1]
  
      return self
  
imports: from typing import List, Optional, Union
  import pandas
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.utils.validation import check_is_fitted
  from feature_engine._variable_handling.init_parameter_checks import _check_init_parameter_variables
  from feature_engine._variable_handling.variable_type_selection import _find_or_check_numerical_variables
  from feature_engine.dataframe_checks import _check_contains_inf, _check_contains_na, _check_X_matches_training_df, check_X
  from feature_engine._base_transformers.mixins import GetFeatureNamesOutMixin
  from feature_engine.tags import _return_tags
label_desc: Use image node_id 2 for calling the WinsorizerBase obj's underlying member method code with example usage: obj.fit(X, y) and returns: self