class_docstr: Implements the proposed method from
  
  "CatBoost: gradient boosting with categorical features support", Dorogush et al. (2018).
  
  The Catboost encoder is a target encoder for categorical features. In this implementation we follow Eq. (1)
  in https://arxiv.org/pdf/1810.11363.pdf.
docstr: :param X: Input categorical data.
  :param Y: Target data (continuous or categorical).
  :param use_alpha_when_unique: If True, uses the alpha value when a category only appears exactly once.
  :return: Catboost encoded inputs based on the given Y.
docstr_tok: [":","param","X",":","Input","categorical","data",".",":","param","Y",":","Target","data","(","continuous","or","categorical",")",".",":","param","use_alpha_when_unique",":","If","True",",","uses","the","alpha","value","when","a","category","only","appears","exactly","once",".",":","return",":","Catboost","encoded","inputs","based","on","the","given","Y","."]
code: def fit_transform(
      self,
      X: np.ndarray,
      Y: np.ndarray,
      use_alpha_when_unique: bool = True,
  ) -> np.ndarray:
      """
  
      :param X: Input categorical data.
      :param Y: Target data (continuous or categorical).
      :param use_alpha_when_unique: If True, uses the alpha value when a category only appears exactly once.
      :return: Catboost encoded inputs based on the given Y.
      """
      return self._fit_transform(
          X, Y, use_alpha_when_unique, train=True
      )
  
file_path: dowhy/dowhy/gcm/util/catboost_encoder.py
imports: from typing import Optional
  import numpy
  from sklearn.preprocessing import LabelEncoder
label_desc: Use image node_id 3 for calling the CatBoostEncoder obj's underlying member method code with example usage: obj.fit_transform(X, Y, use_alpha_when_unique) and returns: self