class_docstr: Class for all standard transformation steps.
class_docstr_tok: ["Class","for","all","standard","transformation","steps","."]
docstr: Perform simple imputation of missing values.
docstr_tok: ["Perform","simple","imputation","of","missing","values","."]
code: def _simple_imputation(
      self, numeric_imputation, categorical_imputation
  ):
      """Perform simple imputation of missing values."""
      self.logger.info("Set up simple imputation.")
  
      # Numerical imputation
      num_dict = {
          "mode": "most_frequent",
          "mean": "mean",
          "median": "median",
      }
      if isinstance(numeric_imputation, str):
          if numeric_imputation.lower() == "drop":
              num_estimator = TransformerWrapper(
                  transformer=DropImputer(columns=self._fxs["Numeric"])
              )
          elif numeric_imputation.lower() == "knn":
              num_estimator = TransformerWrapper(
                  transformer=KNNImputer(),
                  include=self._fxs["Numeric"],
              )
          elif numeric_imputation.lower() in num_dict:
              num_estimator = TransformerWrapper(
                  SimpleImputer(
                      strategy=num_dict[numeric_imputation.lower()]
                  ),
                  include=self._fxs["Numeric"],
              )
          else:
              raise ValueError(
                  "Invalid value for the numeric_imputation parameter, got "
                  f"{numeric_imputation}. Choose from: drop, mean, median, mode, knn."
              )
      else:
          num_estimator = TransformerWrapper(
              SimpleImputer(
                  strategy="constant", fill_value=numeric_imputation
              ),
              include=self._fxs["Numeric"],
          )
  
      if categorical_imputation.lower() == "drop":
          cat_estimator = TransformerWrapper(
              transformer=DropImputer(columns=self._fxs["Categorical"])
          )
      elif categorical_imputation.lower() == "mode":
          cat_estimator = TransformerWrapper(
              transformer=SimpleImputer(strategy="most_frequent"),
              include=self._fxs["Categorical"],
          )
      else:
          cat_estimator = TransformerWrapper(
              SimpleImputer(
                  strategy="constant", fill_value=categorical_imputation
              ),
              include=self._fxs["Categorical"],
          )
  
      self.pipeline.steps.extend(
          [
              ("numerical_imputer", num_estimator),
              ("categorical_imputer", cat_estimator),
          ],
      )
  
imports: from copy import deepcopy
  import numpy
  import pandas
  from category_encoders.basen import BaseNEncoder
  from category_encoders.one_hot import OneHotEncoder
  from category_encoders.ordinal import OrdinalEncoder
  from category_encoders.target_encoder import TargetEncoder
  from imblearn.combine import SMOTEENN, SMOTETomek
  from imblearn.over_sampling import ADASYN, SMOTE, SMOTEN, SMOTENC, SVMSMOTE, BorderlineSMOTE, KMeansSMOTE, RandomOverSampler
  from imblearn.under_sampling import AllKNN, CondensedNearestNeighbour, EditedNearestNeighbours, InstanceHardnessThreshold, NearMiss, NeighbourhoodCleaningRule, OneSidedSelection, RandomUnderSampler, RepeatedEditedNearestNeighbours, TomekLinks
  from sklearn.decomposition import PCA, IncrementalPCA, KernelPCA
  from sklearn.feature_selection import SelectFromModel, SelectKBest, SequentialFeatureSelector, VarianceThreshold, f_classif, f_regression
  from sklearn.impute import KNNImputer, SimpleImputer
  from sklearn.model_selection import GroupKFold, KFold, StratifiedKFold, TimeSeriesSplit, train_test_split
  from sklearn.preprocessing import KBinsDiscretizer, LabelEncoder, MaxAbsScaler, MinMaxScaler, PolynomialFeatures, PowerTransformer, QuantileTransformer, RobustScaler, StandardScaler
  from pycaret.containers.models.classification import get_all_model_containers
  from pycaret.containers.models.regression import get_all_model_containers
  from pycaret.internal.preprocess.iterative_imputer import IterativeImputer
  from pycaret.internal.preprocess.transformers import CleanColumnNames, DropImputer, EmbedTextFeatures, ExtractDateTimeFeatures, FixImbalancer, GroupFeatures, RareCategoryGrouping, RemoveMulticollinearity, RemoveOutliers, TargetTransformer, TransformerWrapper, TransformerWrapperWithInverse
  from pycaret.utils.constants import SEQUENCE
  from pycaret.utils.generic import MLUsecase, check_features_exist, df_shrink_dtypes, get_columns_to_stratify_by, normalize_custom_transformers, to_df, to_series
label_desc: Use image node_id 10 for calling the Preprocessor obj's underlying member method code with example usage: obj._simple_imputation(numeric_imputation, categorical_imputation) without return types