class_docstr: ```
  Tabular preprocessing base class
  ```
class_docstr_tok: ["``","`","Tabular","preprocessing","base","class","``","`"]
docstr: ```
  preprocess training set
  ```
docstr_tok: ["``","`","preprocess","training","set","``","`"]
code: def preprocess_train(self, df, mode="train", verbose=1):
      """
      ```
      preprocess training set
      ```
      """
      df = df.copy()
  
      clean_df(df, pc=self.pc, lc=self.lc, check_labels=mode == "train")
  
      if not isinstance(df, pd.DataFrame):
          raise ValueError("df must be a pd.DataFrame")
  
      # validate columns
      self._validate_columns(df)
  
      # validate mode
      # if mode != 'train' and self.label_transform is None:
      # raise ValueError('self.label_transform is None but mode is %s: are you sure preprocess_train was invoked first?' % (mode))
  
      # verbose
      if verbose:
          print(
              "processing %s: %s rows x %s columns"
              % (mode, df.shape[0], df.shape[1])
          )
  
      # convert date fields
      for field in self.dc:
          df = df.copy()  # TODO: fix this
          df, date_names = add_datepart(df, field)
          self.date_names = date_names
  
      # preprocess labels and data
      if mode == "train":
          label_columns = self.lc[:]
          # label_columns.sort() # leave label columns sorted in same order as in DataFrame
          self.label_transform = U.YTransformDataFrame(
              label_columns, is_regression=self.is_regression
          )
          df = self.label_transform.apply_train(df)
          self.label_columns = (
              self.label_transform.get_classes()
              if not self.is_regression
              else self.label_transform.label_columns
          )
          self.cont_names, self.cat_names = cont_cat_split(
              df,
              label_columns=self.label_columns,
              max_card=self.max_card,
          )
          self.procs = [
              proc(self.cat_names, self.cont_names)
              for proc in self.procs
          ]  # "objectivy"
      else:
          df = self.label_transform.apply_test(df)
      for proc in self.procs:
          proc(df, test=mode != "train")  # apply processors
      from .dataset import TabularDataset
  
      return TabularDataset(
          df, self.cat_names, self.cont_names, self.label_columns
      )
  
imports: from ..None import utils
  from ..imports import *
  from ..preprocessor import Preprocessor
  from numbers import Number
  from types import SimpleNamespace
  from typing import Any, AnyStr, Callable, Collection, Dict, Hashable, Iterator, List, Mapping, NewType, Optional, Sequence, Tuple, TypeVar, Union
  from pandas.api.types import is_categorical_dtype, is_numeric_dtype
label_desc: Use image node_id 8 for calling the TabularPreprocessor obj's underlying member method code with example usage: obj.preprocess_train(df, mode, verbose) and returns: TabularDataset