code: def preprocess_mlp(dataset, log):
      """
      For MLP:
      - For numerical features, normalize them after null imputation.
      - For categorical features, use one-hot encoding after null imputation.
      """
      cat_columns, num_columns = [], []
      shift_amount = 0
      for i, f in enumerate(dataset.features):
          if f.is_target:
              shift_amount += 1
              continue
          elif f.is_categorical():
              cat_columns.append(i - shift_amount)
          else:
              num_columns.append(i - shift_amount)
  
      cat_pipeline = Pipeline(
          [
              ("imputer", SimpleImputer(strategy="most_frequent")),
              ("onehot_encoder", OneHotEncoder()),
          ]
      )
  
      num_pipeline = Pipeline(
          [
              ("imputer", SimpleImputer(strategy="mean")),
              ("standard_scaler", StandardScaler()),
          ]
      )
  
      data_pipeline = ColumnTransformer(
          [
              ("categorical", cat_pipeline, cat_columns),
              ("numerical", num_pipeline, num_columns),
          ]
      )
  
      data_pipeline.fit(
          np.concatenate([dataset.train.X, dataset.test.X], axis=0)
      )
  
      X_train = data_pipeline.transform(dataset.train.X)
      X_test = data_pipeline.transform(dataset.test.X)
  
      return X_train, X_test
  
file_path: nni/examples/trials/benchmarking/automlbenchmark/nni/extensions/NNI/architectures/run_mlp.py
imports: import logging
  import sklearn
  import time
  import numpy
  from sklearn.impute import SimpleImputer
  from sklearn.compose import ColumnTransformer
  from sklearn.preprocessing import OneHotEncoder, StandardScaler
  from sklearn.pipeline import Pipeline
  from sklearn.neural_network import MLPClassifier, MLPRegressor
  from sklearn.model_selection import cross_val_score
  from amlb.benchmark import TaskConfig
  from amlb.data import Dataset
  from amlb.datautils import impute
  from amlb.utils import Timer
  from amlb.results import save_predictions_to_file
label_desc: Use image node_id 1 for calling a global function with example usage: preprocess_mlp(dataset, log) and returns: X_train,  X_test