class_docstr: Target Encoder for categorical features.
class_docstr_tok: ["Target","Encoder","for","categorical","features","."]
docstr: Label Encode given columns of X.
  
  :param pandas.DataFrame X: DataFrame of features, shape (n_samples, n_features). Must contain columns to encode.
  :return: None
docstr_tok: ["Label","Encode","given","columns","of","X.",":","param","pandas.DataFrame","X",":","DataFrame","of","features",",","shape","(","n_samples",",","n_features",")",".","Must","contain","columns","to","encode",".",":","return",":","None"]
code: def fit(self, X, y=None):
      """Label Encode given columns of X.
  
      :param pandas.DataFrame X: DataFrame of features, shape (n_samples, n_features). Must contain columns to encode.
      :return: None
      """
      self._before_fit_check(X, y)
      if self.handle_missing == "error":
          assert (
              not X[self.cols].isnull().any().any()
          ), "`handle_missing` = `error` and missing values found in columns to encode."
      for col in self.cols:
          map = (
              Series(unique(X[col].fillna(NAN_CATEGORY)), name=col)
              .reset_index()
              .rename(columns={"index": "value"})
          )
          map["value"] += 1
          self._mapping[col] = map.set_index(col)
  
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 2 for calling the OrdinalEncoder obj's underlying member method code with example usage: obj.fit(X, y) without return types