docstr: Input:
  data : dataframe or x_test
  Column Transformer: Sklearn ColumnTransformer that applies transformers to columns of an array or pandas DataFrame.
  
  Returns:
  Column Transformer function after fit. 
docstr_tok: ["Input",":","data",":","dataframe","or","x_test","Column","Transformer",":","Sklearn","ColumnTransformer","that","applies","transformers","to","columns","of","an","array","or","pandas","DataFrame",".","Returns",":","Column","Transformer","function","after","fit","."]
code: def columnsTransformer(self):
      """
      Input:
      data : dataframe or x_test
      Column Transformer: Sklearn ColumnTransformer that applies transformers to columns of an array or pandas DataFrame.
  
      Returns:
      Column Transformer function after fit.
      """
      from sklearn.pipeline import Pipeline
      from sklearn.preprocessing import (
          StandardScaler,
          OneHotEncoder,
          FunctionTransformer,
      )
      from sklearn.compose import ColumnTransformer
  
      category_cols, numerical_cols = self.num_cat_variables(
          self.input_data
      )
      category_map = self.gen_category_map(
          self.input_data, category_cols
      )
  
      if self.ct == None:
          pass
      elif self.ct == "default":
          ordinal_features = [
              x
              for x in range(len(self.input_data.columns))
              if x not in list(category_map.keys())
          ]
          ordinal_transformer = Pipeline(
              steps=[
                  ("imputer", SimpleImputer(strategy="median")),
                  ("scaler", StandardScaler()),
              ]
          )
  
          categorical_features = list(category_map.keys())
          categorical_transformer = Pipeline(
              steps=[
                  ("imputer", SimpleImputer(strategy="most_frequent")),
                  (
                      "onehot",
                      OneHotEncoder(
                          drop="first", handle_unknown="error"
                      ),
                  ),
              ]
          )
  
          # pass the pipeline into the transformer
          preprocessor = ColumnTransformer(
              transformers=[
                  ("num", ordinal_transformer, ordinal_features),
                  (
                      "cat",
                      categorical_transformer,
                      categorical_features,
                  ),
              ]
          )
          preprocessor.fit(self.input_data)
          return preprocessor
      else:
          transformerFunction = ct.fit(self.input_data)
          # transformed_xtest = ct.transform(x_test)
          return transformerFunction
  
file_path: explainx/lib/models/modelprocessor.py
imports: from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
  import numpy
  import pandas
  from sklearn.preprocessing import LabelEncoder
  from typing import Dict, List, Union
  from sklearn.impute import SimpleImputer
  from explainx.lib.utils import is_classification
label_desc: Use image node_id 4 for calling the ModelProcessor obj's underlying member method code with example usage: obj.columnsTransformer() and returns: preprocessor, transformerFunction