docstr: Parameters
  ----------
  
  verbose: int
      integer indicating verbosity of output. 0 for none.
  cols: list
      a list of columns to encode, if None, all string and categorical columns
      will be encoded.
  drop_invariant: bool
      boolean for whether or not to drop columns with 0 variance.
  return_df: bool
      boolean for whether to return a pandas DataFrame from transform and inverse transform
      (otherwise it will be a numpy array).
  handle_missing: str
      how to handle missing values at fit time. Options are 'error', 'return_nan',
      and 'value'. Default 'value', which treat NaNs as a countable category at
      fit time.
  handle_unknown: str, int or dict of {column : option, ...}.
      how to handle unknown labels at transform time. Options are 'error'
      'return_nan', 'value' and int. Defaults to None which uses NaN behaviour
      specified at fit time. Passing an int will fill with this int value.
  kwargs: dict.
      additional encoder specific parameters like regularisation.
docstr_tok: ["Parameters","--","--","--","--","--","verbose",":","int","integer","indicating","verbosity","of","output",".","0","for","none",".","cols",":","list","a","list","of","columns","to","encode",",","if","None",",","all","string","and","categorical","columns","will","be","encoded",".","drop_invariant",":","bool","boolean","for","whether","or","not","to","drop","columns","with","0","variance",".","return_df",":","bool","boolean","for","whether","to","return","a","pandas","DataFrame","from","transform","and","inverse","transform","(","otherwise","it","will","be","a","numpy","array",")",".","handle_missing",":","str","how","to","handle","missing","values","at","fit","time",".","Options","are","'error","'",",","'return_nan","'",",","and","'value","'",".","Default","'value","'",",","which","treat","NaNs","as","a","countable","category","at","fit","time",".","handle_unknown",":","str",",","int","or","dict","of","{","column",":","option",",","...","}",".","how","to","handle","unknown","labels","at","transform","time",".","Options","are","'error'","'return_nan","'",",","'value","'","and","int",".","Defaults","to","None","which","uses","NaN","behaviour","specified","at","fit","time",".","Passing","an","int","will","fill","with","this","int","value",".","kwargs",":","dict",".","additional","encoder","specific","parameters","like","regularisation","."]
code: def __init__(
      self,
      verbose=0,
      cols=None,
      drop_invariant=False,
      return_df=True,
      handle_unknown="value",
      handle_missing="value",
      **kwargs,
  ):
      """
  
      Parameters
      ----------
  
      verbose: int
          integer indicating verbosity of output. 0 for none.
      cols: list
          a list of columns to encode, if None, all string and categorical columns
          will be encoded.
      drop_invariant: bool
          boolean for whether or not to drop columns with 0 variance.
      return_df: bool
          boolean for whether to return a pandas DataFrame from transform and inverse transform
          (otherwise it will be a numpy array).
      handle_missing: str
          how to handle missing values at fit time. Options are 'error', 'return_nan',
          and 'value'. Default 'value', which treat NaNs as a countable category at
          fit time.
      handle_unknown: str, int or dict of {column : option, ...}.
          how to handle unknown labels at transform time. Options are 'error'
          'return_nan', 'value' and int. Defaults to None which uses NaN behaviour
          specified at fit time. Passing an int will fill with this int value.
      kwargs: dict.
          additional encoder specific parameters like regularisation.
      """
      self.return_df = return_df
      self.drop_invariant = drop_invariant
      self.invariant_cols = []
      self.verbose = verbose
      self.use_default_cols = (
          cols is None
      )  # if True, even a repeated call of fit() will select string columns from X
      self.cols = cols  # note that cols are only the columns to be encoded, feature_names_in_ are all columns
      self.mapping = None
      self.handle_unknown = handle_unknown
      self.handle_missing = handle_missing
      self._dim = None
  
imports: from abc import abstractmethod
  from enum import Enum, auto
  import warnings
  import pandas
  import numpy
  import sklearn.base
  from pandas.api.types import is_object_dtype, is_string_dtype, is_numeric_dtype
  from pandas.core.dtypes.dtypes import CategoricalDtype
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.exceptions import NotFittedError
  from typing import Dict, List, Optional, Union
  from scipy.sparse import csr_matrix
  from sklearn.preprocessing import LabelEncoder
label_desc: Use image node_id 1 to create a new BaseEncoder object from inherited base classes: BaseEstimator with example: obj = BaseEncoder(verbose, cols, drop_invariant, return_df, handle_unknown, handle_missing)