code: def create_complex_classification_pipeline(
      X_train, y_train, continuous_features, categorical_features
  ):
      """Create a complex sklearn pipeline for classification.
  
      param X_train: The training data.
      type X_train: numpy.ndarray or pandas.DataFrame
      param y_train: The training labels.
      type y_train: numpy.ndarray or pandas.DataFrame
      param continuous_features: The continuous features.
      type continuous_features: list
      param categorical_features: The categorical features.
      type categorical_features: list
      return: A complex sklearn pipeline for classification.
      rtype: sklearn.pipeline.Pipeline
      """
      # We create the preprocessing pipelines for both
      # numeric and categorical data.
      numeric_transformer = Pipeline(
          steps=[
              ("imputer", SimpleImputer(strategy="median")),
              ("scaler", StandardScaler()),
          ]
      )
  
      categorical_transformer = Pipeline(
          steps=[("onehot", OneHotEncoder(handle_unknown="ignore"))]
      )
  
      transformations = ColumnTransformer(
          transformers=[
              ("num", numeric_transformer, continuous_features),
              ("cat", categorical_transformer, categorical_features),
          ]
      )
  
      # Append classifier to preprocessing pipeline.
      # Now we have a full prediction pipeline.
      pipeline = Pipeline(
          steps=[
              ("preprocessor", transformations),
              ("classifier", RandomForestClassifier()),
          ]
      )
      return pipeline.fit(X_train, y_train)
  
file_path: responsible-ai-toolbox/rai_test_utils/rai_test_utils/models/sklearn/sklearn_model_utils.py
imports: import numpy
  import pandas
  from sklearn import svm
  from sklearn.compose import ColumnTransformer
  from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
  from sklearn.impute import SimpleImputer
  from sklearn.linear_model import LogisticRegression
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import FunctionTransformer, OneHotEncoder, StandardScaler
label_desc: Use image node_id 7 for calling a global function with example usage: create_complex_classification_pipeline(X_train, y_train, continuous_features, categorical_features) and returns: pipeline