docstr: Handle sklearn functions
  
  Use Sklearn's regression to train models.
docstr_tok: ["Handle","sklearn","functions","Use","Sklearn","'s","regression","to","train","models","."]
code: def handle_sklearn_function(self):
      """Handle sklearn functions
  
      Use Sklearn's regression to train models.
      """
      try_to_import_flaml_automl()
  
      assert (
          len(self.children) == 1
      ), "Create sklearn function expects 1 child, finds {}.".format(
          len(self.children)
      )
  
      aggregated_batch_list = []
      child = self.children[0]
      for batch in child.exec():
          aggregated_batch_list.append(batch)
      aggregated_batch = Batch.concat(aggregated_batch_list, copy=False)
      aggregated_batch.drop_column_alias()
  
      arg_map = {arg.key: arg.value for arg in self.node.metadata}
      from flaml import AutoML
  
      model = AutoML()
      sklearn_model = arg_map.get("model", DEFAULT_SKLEARN_TRAIN_MODEL)
      if sklearn_model not in SKLEARN_SUPPORTED_MODELS:
          raise ValueError(
              f"Sklearn Model {sklearn_model} provided as input is not supported."
          )
      settings = {
          "time_budget": arg_map.get(
              "time_limit", DEFAULT_TRAIN_TIME_LIMIT
          ),
          "metric": arg_map.get(
              "metric", DEFAULT_TRAIN_REGRESSION_METRIC
          ),
          "estimator_list": [sklearn_model],
          "task": arg_map.get("task", DEFAULT_XGBOOST_TASK),
      }
      start_time = int(time.time())
      model.fit(
          dataframe=aggregated_batch.frames,
          label=arg_map["predict"],
          **settings,
      )
      train_time = int(time.time()) - start_time
      score = model.best_loss
      model_path = os.path.join(
          self.db.catalog().get_configuration_catalog_value(
              "model_dir"
          ),
          self.node.name,
      )
      pickle.dump(model, open(model_path, "wb"))
      self.node.metadata.append(
          FunctionMetadataCatalogEntry("model_path", model_path)
      )
      # Pass the prediction column name to sklearn.py
      self.node.metadata.append(
          FunctionMetadataCatalogEntry(
              "predict_col", arg_map["predict"]
          )
      )
  
      impl_path = (
          Path(f"{self.function_dir}/sklearn.py").absolute().as_posix()
      )
      io_list = self._resolve_function_io(None)
      return (
          self.node.name,
          impl_path,
          self.node.function_type,
          io_list,
          self.node.metadata,
          score,
          train_time,
      )
  
imports: import contextlib
  import hashlib
  import locale
  import os
  import pickle
  import re
  import time
  from pathlib import Path
  from typing import Dict, List
  import numpy
  import pandas
  from evadb.catalog.catalog_utils import get_metadata_properties
  from evadb.catalog.models.function_catalog import FunctionCatalogEntry
  from evadb.catalog.models.function_io_catalog import FunctionIOCatalogEntry
  from evadb.catalog.models.function_metadata_catalog import FunctionMetadataCatalogEntry
  from evadb.configuration.constants import DEFAULT_SKLEARN_TRAIN_MODEL, DEFAULT_TRAIN_REGRESSION_METRIC, DEFAULT_TRAIN_TIME_LIMIT, DEFAULT_XGBOOST_TASK, SKLEARN_SUPPORTED_MODELS, EvaDB_INSTALLATION_DIR
  from evadb.database import EvaDBDatabase
  from evadb.executor.abstract_executor import AbstractExecutor
  from evadb.functions.decorators.utils import load_io_from_function_decorators
  from evadb.models.storage.batch import Batch
  from evadb.plan_nodes.create_function_plan import CreateFunctionPlan
  from evadb.third_party.huggingface.create import gen_hf_io_catalog_entries
  from evadb.utils.errors import FunctionIODefinitionError
  from evadb.utils.generic_utils import load_function_class_from_file, string_comparison_case_insensitive, try_to_import_flaml_automl, try_to_import_ludwig, try_to_import_neuralforecast, try_to_import_statsforecast, try_to_import_torch, try_to_import_ultralytics
  from evadb.utils.logging_manager import logger
label_desc: Use image node_id 4 for calling the CreateFunctionExecutor obj's underlying member method code with example usage: obj.handle_sklearn_function() and returns: self,  impl_path,  self,  io_list,  self,  score,  train_time