class_docstr: Class for all standard transformation steps.
class_docstr_tok: ["Class","for","all","standard","transformation","steps","."]
docstr: Perform iterative imputation of missing values.
docstr_tok: ["Perform","iterative","imputation","of","missing","values","."]
code: def _iterative_imputation(
      self,
      iterative_imputation_iters,
      numeric_iterative_imputer,
      categorical_iterative_imputer,
  ):
      """Perform iterative imputation of missing values."""
      self.logger.info("Set up iterative imputation.")
  
      # Dict of all regressor models available
      regressors = {
          k: v
          for k, v in get_all_reg_model_containers(self).items()
          if not v.is_special
      }
      # Dict of all classifier models available
      classifiers = {
          k: v
          for k, v in get_all_class_model_containers(self).items()
          if not v.is_special
      }
  
      if isinstance(numeric_iterative_imputer, str):
          if numeric_iterative_imputer not in regressors:
              raise ValueError(
                  "Invalid value for the numeric_iterative_imputer "
                  f"parameter, got {numeric_iterative_imputer}. "
                  f"Allowed estimators are: {', '.join(regressors)}."
              )
          numeric_iterative_imputer = regressors[
              numeric_iterative_imputer
          ].class_def(**regressors[numeric_iterative_imputer].args)
      elif not hasattr(numeric_iterative_imputer, "predict"):
          raise ValueError(
              "Invalid value for the numeric_iterative_imputer "
              "parameter. The provided estimator does not adhere "
              "to sklearn's API."
          )
  
      if isinstance(categorical_iterative_imputer, str):
          if categorical_iterative_imputer not in classifiers:
              raise ValueError(
                  "Invalid value for the categorical_iterative_imputer "
                  "parameter, got {categorical_iterative_imputer}. "
                  f"Allowed estimators are: {', '.join(classifiers)}."
              )
          categorical_iterative_imputer = classifiers[
              categorical_iterative_imputer
          ].class_def(**classifiers[categorical_iterative_imputer].args)
      elif not hasattr(categorical_iterative_imputer, "predict"):
          raise ValueError(
              "Invalid value for the categorical_iterative_imputer "
              "parameter. The provided estimator does not adhere "
              "to sklearn's API."
          )
  
      categorical_indices = [
          i
          for i in range(len(self.X.columns))
          if self.X.columns[i] in self._fxs["Categorical"]
      ]
  
      def get_prepare_estimator_for_categoricals_type(
          estimator, estimators_dict
      ):
          # See pycaret.internal.preprocess.iterative_imputer
          fit_params = {}
          if not categorical_indices:
              return estimator, fit_params
          if isinstance(
              estimator, estimators_dict["lightgbm"].class_def
          ):
              return "fit_params_categorical_feature"
          elif "catboost" in estimators_dict and isinstance(
              estimator, estimators_dict["catboost"].class_def
          ):
              return "params_cat_features"
          elif "xgboost" in estimators_dict and isinstance(
              estimator, estimators_dict["xgboost"].class_def
          ):
              return "ordinal"
          elif isinstance(
              estimator,
              (
                  estimators_dict["rf"].class_def,
                  estimators_dict["et"].class_def,
                  estimators_dict["dt"].class_def,
                  estimators_dict["ada"].class_def,
                  estimators_dict.get(
                      "gbr",
                      estimators_dict.get("gbc", estimators_dict["rf"]),
                  ).class_def,
              ),
          ):
              return "ordinal"
          else:
              return "one_hot"
  
      imputer = TransformerWrapper(
          transformer=IterativeImputer(
              num_estimator=numeric_iterative_imputer,
              cat_estimator=categorical_iterative_imputer,
              skip_complete=True,
              max_iter=iterative_imputation_iters,
              random_state=self.seed,
              categorical_indices=categorical_indices,
              num_estimator_prepare_for_categoricals_type=get_prepare_estimator_for_categoricals_type(
                  estimator=numeric_iterative_imputer,
                  estimators_dict=regressors,
              ),
              cat_estimator_prepare_for_categoricals_type=get_prepare_estimator_for_categoricals_type(
                  estimator=categorical_iterative_imputer,
                  estimators_dict=classifiers,
              ),
          ),
      )
      self.pipeline.steps.append(("iterative_imputer", imputer))
  
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 11 for calling the Preprocessor obj's underlying member method code with example usage: obj._iterative_imputation(iterative_imputation_iters, numeric_iterative_imputer, categorical_iterative_imputer) and returns: estimator,  fit_params, str, str, str, str, str