class_docstr: Class for all standard transformation steps.
class_docstr_tok: ["Class","for","all","standard","transformation","steps","."]
docstr: Make the train/test split.
docstr_tok: ["Make","the","train\/test","split","."]
code: def _prepare_train_test(
      self,
      train_size,
      test_data,
      data_split_stratify,
      data_split_shuffle,
  ):
      """Make the train/test split."""
      self.logger.info("Set up train/test split.")
  
      if test_data is None:
          if isinstance(self.index, SEQUENCE):
              if len(self.index) != len(self.data):
                  raise ValueError(
                      "Invalid value for the index parameter. Length of "
                      f"index ({len(self.index)}) doesn't match that of "
                      f"the dataset ({len(self.data)})."
                  )
              self.data.index = self.index
  
          # self.data is already prepared here
          train, test = train_test_split(
              self.data,
              train_size=train_size,
              stratify=get_columns_to_stratify_by(
                  self.X, self.y, data_split_stratify
              ),
              random_state=self.seed,
              shuffle=data_split_shuffle,
          )
          self.data = self._set_index(pd.concat([train, test]))
          self.idx = [
              self.data.index[: len(train)],
              self.data.index[-len(test) :],
          ]
  
      else:  # test_data is provided
          test_data = self._prepare_dataset(
              test_data, self.target_param
          )
  
          if isinstance(self.index, SEQUENCE):
              if len(self.index) != len(self.data) + len(test_data):
                  raise ValueError(
                      "Invalid value for the index parameter. Length of "
                      f"index ({len(self.index)}) doesn't match that of "
                      f"the data sets ({len(self.data) + len(test_data)})."
                  )
              self.data.index = self.index[: len(self.data)]
              test_data.index = self.index[-len(test_data) :]
  
          self.data = self._set_index(pd.concat([self.data, test_data]))
          self.idx = [
              self.data.index[: -len(test_data)],
              self.data.index[-len(test_data) :],
          ]
  
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 3 for calling the Preprocessor obj's underlying member method code with example usage: obj._prepare_train_test(train_size, test_data, data_split_stratify, data_split_shuffle) without return types