class_docstr: Target Encoder for categorical features.
class_docstr_tok: ["Target","Encoder","for","categorical","features","."]
docstr: Instantiation.
  
  :param [str] cols: list of columns to encode, or None (then all dataset columns will be encoded at fitting time)
  :param str handle_unseen:
      'error'  - raise an error if a category unseen at fitting time is found
      'ignore' - skip unseen categories
      'impute' - impute new categories to a predefined value, which is same as NAN_CATEGORY
  :return: None
docstr_tok: ["Instantiation",".",":","param","[","str","]","cols",":","list","of","columns","to","encode",",","or","None","(","then","all","dataset","columns","will","be","encoded","at","fitting","time",")",":","param","str","handle_unseen",":","'error","'","-","raise","an","error","if","a","category","unseen","at","fitting","time","is","found","'ignore","'","-","skip","unseen","categories","'impute","'","-","impute","new","categories","to","a","predefined","value",",","which","is","same","as","NAN_CATEGORY",":","return",":","None"]
code: def __init__(
      self, cols=None, handle_unseen="impute", handle_missing="impute"
  ):
      """Instantiation.
  
      :param [str] cols: list of columns to encode, or None (then all dataset columns will be encoded at fitting time)
      :param str handle_unseen:
          'error'  - raise an error if a category unseen at fitting time is found
          'ignore' - skip unseen categories
          'impute' - impute new categories to a predefined value, which is same as NAN_CATEGORY
      :return: None
      """
      self._input_check(
          "handle_unseen", handle_unseen, ["error", "ignore", "impute"]
      )
      self._input_check(
          "handle_missing", handle_missing, ["error", "impute"]
      )
      super().__init__(
          cols, handle_unseen, 1, NAN_CATEGORY, handle_missing
      )
  
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 1 to create a new OrdinalEncoder object from inherited base classes: BaseEncoder with example: obj = OrdinalEncoder(cols, handle_unseen, handle_missing)