class_docstr: Unit test Smart Predictor class
class_docstr_tok: ["Unit","test","Smart","Predictor","class"]
docstr: Test check preprocessing on multiple preprocessing
docstr_tok: ["Test","check","preprocessing","on","multiple","preprocessing"]
code: def test_check_preprocessing_1(
      self,
      check_consistency_model_label,
      check_consistency_model_features,
      check_preprocessing_options,
      check_model,
  ):
      """
      Test check preprocessing on multiple preprocessing
      """
      train = pd.DataFrame(
          {
              "Onehot1": ["A", "B", "A", "B"],
              "Onehot2": ["C", "D", "C", "D"],
              "Binary1": ["E", "F", "E", "F"],
              "Binary2": ["G", "H", "G", "H"],
              "Ordinal1": ["I", "J", "I", "J"],
              "Ordinal2": ["K", "L", "K", "L"],
              "BaseN1": ["M", "N", "M", "N"],
              "BaseN2": ["O", "P", "O", "P"],
              "Target1": ["Q", "R", "Q", "R"],
              "Target2": ["S", "T", "S", "T"],
              "other": ["other", np.nan, "other", "other"],
          }
      )
  
      features_dict = None
      columns_dict = {
          i: features for i, features in enumerate(train.columns)
      }
      features_types = {
          features: str(train[features].dtypes)
          for features in train.columns
      }
      label_dict = None
  
      enc_ordinal_all = ce.OrdinalEncoder(
          cols=[
              "Onehot1",
              "Onehot2",
              "Binary1",
              "Binary2",
              "Ordinal1",
              "Ordinal2",
              "BaseN1",
              "BaseN2",
              "Target1",
              "Target2",
              "other",
          ]
      ).fit(train)
      train_ordinal_all = enc_ordinal_all.transform(train)
  
      y = pd.DataFrame({"y_class": [0, 0, 0, 1]})
  
      model = cb.CatBoostClassifier(n_estimators=1).fit(
          train_ordinal_all, y
      )
      backend = ShapBackend(model=model)
  
      check_preprocessing_options.return_value = True
      check_consistency_model_features.return_value = True
      check_consistency_model_label.return_value = True
      check_model.return_value = "classification", [0, 1]
  
      predictor_1 = SmartPredictor(
          features_dict,
          model,
          columns_dict,
          backend,
          features_types,
          label_dict,
      )
  
      y = pd.DataFrame(data=[0, 1, 0, 0], columns=["y"])
  
      enc_onehot = ce.OneHotEncoder(cols=["Onehot1", "Onehot2"]).fit(
          train
      )
      train_onehot = enc_onehot.transform(train)
      enc_binary = ce.BinaryEncoder(cols=["Binary1", "Binary2"]).fit(
          train_onehot
      )
      train_binary = enc_binary.transform(train_onehot)
      enc_ordinal = ce.OrdinalEncoder(
          cols=["Ordinal1", "Ordinal2"]
      ).fit(train_binary)
      train_ordinal = enc_ordinal.transform(train_binary)
      enc_basen = ce.BaseNEncoder(cols=["BaseN1", "BaseN2"]).fit(
          train_ordinal
      )
      train_basen = enc_basen.transform(train_ordinal)
      enc_target = ce.TargetEncoder(cols=["Target1", "Target2"]).fit(
          train_basen, y
      )
  
      input_dict1 = dict()
      input_dict1["col"] = "Onehot2"
      input_dict1["mapping"] = pd.Series(
          data=["C", "D", np.nan], index=["C", "D", "missing"]
      )
      input_dict1["data_type"] = "object"
  
      input_dict2 = dict()
      input_dict2["col"] = "Binary2"
      input_dict2["mapping"] = pd.Series(
          data=["G", "H", np.nan], index=["G", "H", "missing"]
      )
      input_dict2["data_type"] = "object"
  
      input_dict = dict()
      input_dict["col"] = "state"
      input_dict["mapping"] = pd.Series(
          data=["US", "FR-1", "FR-2"], index=["US", "FR", "FR"]
      )
      input_dict["data_type"] = "object"
  
      input_dict3 = dict()
      input_dict3["col"] = "Ordinal2"
      input_dict3["mapping"] = pd.Series(
          data=["K", "L", np.nan], index=["K", "L", "missing"]
      )
      input_dict3["data_type"] = "object"
      list_dict = [input_dict2, input_dict3]
  
      y = pd.DataFrame(data=[0, 1], columns=["y"])
  
      train = pd.DataFrame(
          {
              "city": ["chicago", "paris"],
              "state": ["US", "FR"],
              "other": ["A", "B"],
          }
      )
      enc = ColumnTransformer(
          transformers=[
              ("onehot", skp.OneHotEncoder(), ["city", "state"])
          ],
          remainder="drop",
      )
      enc.fit(train, y)
  
      wrong_prepro = skp.OneHotEncoder().fit(train, y)
  
      predictor_1.preprocessing = [
          enc_onehot,
          enc_binary,
          enc_ordinal,
          enc_basen,
          enc_target,
          input_dict1,
          list_dict,
      ]
      predictor_1.check_preprocessing()
  
      for preprocessing in [
          enc_onehot,
          enc_binary,
          enc_ordinal,
          enc_basen,
          enc_target,
      ]:
          predictor_1.preprocessing = preprocessing
          predictor_1.check_preprocessing()
  
      predictor_1.preprocessing = input_dict2
      predictor_1.check_preprocessing()
  
      predictor_1.preprocessing = enc
      predictor_1.check_preprocessing()
  
      predictor_1.preprocessing = None
      predictor_1.check_preprocessing()
  
      with self.assertRaises(Exception):
          predictor_1.preprocessing = wrong_prepro
          predictor_1.check_preprocessing()
  
imports: import unittest
  from shapash.explainer.smart_predictor import SmartPredictor
  from shapash import SmartExplainer
  from shapash.explainer.smart_state import SmartState
  from shapash.explainer.multi_decorator import MultiDecorator
  from shapash.backend import ShapBackend
  import os
  from os import path
  from pathlib import Path
  import pandas
  import numpy
  import catboost
  from catboost import Pool
  import category_encoders
  from unittest.mock import patch
  import types
  from sklearn.compose import ColumnTransformer
  import sklearn.preprocessing
  import shap
label_desc: Use image node_id 11 for calling the TestSmartPredictor obj's underlying member method code with example usage: obj.test_check_preprocessing_1(check_consistency_model_label, check_consistency_model_features, check_preprocessing_options, check_model) without return types