code: def transform(
      self, X_validation, y_validation, sample_weight_validation=None
  ):
      logger.debug("Preprocessing.transform")
  
      # doing copy to avoid SettingWithCopyWarning
      if X_validation is not None:
          X_validation = X_validation.copy(deep=False)
      if y_validation is not None:
          y_validation = y_validation.copy(deep=False)
  
      # target preprocessing
      # this must be used first, maybe we will drop some rows because of missing target values
      if y_validation is not None:
          target_preprocessing = self._params.get(
              "target_preprocessing"
          )
          logger.debug(
              "target_preprocessing -> {}".format(target_preprocessing)
          )
  
          (
              X_validation,
              y_validation,
              sample_weight_validation,
              _,
          ) = ExcludeRowsMissingTarget.transform(
              X_validation, y_validation, sample_weight_validation
          )
  
          if (
              PreprocessingCategorical.CONVERT_INTEGER
              in target_preprocessing
          ):
              if (
                  y_validation is not None
                  and self._categorical_y is not None
              ):
                  y_validation = pd.Series(
                      self._categorical_y.transform(y_validation)
                  )
  
          if (
              PreprocessingCategorical.CONVERT_ONE_HOT
              in target_preprocessing
          ):
              if (
                  y_validation is not None
                  and self._categorical_y is not None
              ):
                  y_validation = self._categorical_y.transform(
                      pd.DataFrame({"target": y_validation}), "target"
                  )
  
          if Scale.SCALE_LOG_AND_NORMAL in target_preprocessing:
              if self._scale_y is not None and y_validation is not None:
                  logger.debug("Transform log and normalize")
                  y_validation = pd.DataFrame({"target": y_validation})
                  y_validation = self._scale_y.transform(y_validation)
                  y_validation = y_validation["target"]
  
          if Scale.SCALE_NORMAL in target_preprocessing:
              if self._scale_y is not None and y_validation is not None:
                  logger.debug("Transform normalize")
                  y_validation = pd.DataFrame({"target": y_validation})
                  y_validation = self._scale_y.transform(y_validation)
                  y_validation = y_validation["target"]
  
      # columns preprocessing
      if len(self._remove_columns) and X_validation is not None:
          cols_to_remove = [
              col
              for col in X_validation.columns
              if col in self._remove_columns
          ]
          X_validation.drop(cols_to_remove, axis=1, inplace=True)
  
      # text transform
      for tt in self._text_transforms:
          if X_validation is not None and tt is not None:
              X_validation = tt.transform(X_validation)
  
      for missing in self._missing_values:
          if X_validation is not None and missing is not None:
              X_validation = missing.transform(X_validation)
  
      # to be sure that all missing are filled
      # in case new data there can be gaps!
      if (
          X_validation is not None
          and pd.isnull(X_validation).sum().sum() > 0
          and len(self._params["columns_preprocessing"]) > 0
      ):
          # there is something missing, fill it
          # we should notice user about it!
          # warnings should go to the separate file ...
          # warnings.warn(
          #    "There are columns {} with missing values which didnt have missing values in train dataset.".format(
          #        list(
          #            X_validation.columns[np.where(np.sum(pd.isnull(X_validation)))]
          #        )
          #    )
          # )
          missing = PreprocessingMissingValues(
              X_validation.columns,
              PreprocessingMissingValues.FILL_NA_MEDIAN,
          )
          missing.fit(X_validation)
          X_validation = missing.transform(X_validation)
  
      # golden features
      if self._golden_features is not None:
          X_validation = self._golden_features.transform(X_validation)
  
      if self._kmeans is not None:
          X_validation = self._kmeans.transform(X_validation)
  
      for convert in self._categorical:
          if X_validation is not None and convert is not None:
              X_validation = convert.transform(X_validation)
  
      for dtt in self._datetime_transforms:
          if X_validation is not None and dtt is not None:
              X_validation = dtt.transform(X_validation)
  
      for scale in self._scale:
          if X_validation is not None and scale is not None:
              X_validation = scale.transform(X_validation)
  
      if self._add_random_feature:
          # -1, 1, with 0 mean
          X_validation["random_feature"] = (
              np.random.rand(X_validation.shape[0]) * 2.0 - 1.0
          )
  
      if self._drop_features and X_validation is not None:
          X_validation.drop(self._drop_features, axis=1, inplace=True)
  
      if X_validation is not None:
          # there can be catagorical columns (in CatBoost) which cant be clipped
          numeric_cols = X_validation.select_dtypes(
              include="number"
          ).columns.tolist()
          X_validation[numeric_cols] = X_validation[numeric_cols].clip(
              lower=np.finfo(np.float32).min + 1000,
              upper=np.finfo(np.float32).max - 1000,
          )
  
      return X_validation, y_validation, sample_weight_validation
  
imports: import copy
  import logging
  import warnings
  import numpy
  import pandas
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION
  from supervised.exceptions import AutoMLException
  from supervised.preprocessing.datetime_transformer import DateTimeTransformer
  from supervised.preprocessing.exclude_missing_target import ExcludeRowsMissingTarget
  from supervised.preprocessing.goldenfeatures_transformer import GoldenFeaturesTransformer
  from supervised.preprocessing.kmeans_transformer import KMeansTransformer
  from supervised.preprocessing.label_binarizer import LabelBinarizer
  from supervised.preprocessing.label_encoder import LabelEncoder
  from supervised.preprocessing.preprocessing_categorical import PreprocessingCategorical
  from supervised.preprocessing.preprocessing_missing import PreprocessingMissingValues
  from supervised.preprocessing.preprocessing_utils import PreprocessingUtils
  from supervised.preprocessing.scale import Scale
  from supervised.preprocessing.text_transformer import TextTransformer
  from supervised.utils.config import LOG_LEVEL
label_desc: Use image node_id 4 for calling the Preprocessing obj's underlying member method code with example usage: obj.transform(X_validation, y_validation, sample_weight_validation) and returns: X_validation,  y_validation,  sample_weight_validation