docstr: Automatically fit the model and search for the best hyperparameters.
  
  :param data: A Spark DataFrame, a tuple of ndarrays or a function.
      If data is a tuple of ndarrays, it should be in the form of (x, y),
      where x is training input data and y is training target data.
      If data is a function, it should takes config as argument and returns a tuple of
      ndarrays in the form of (x, y).
  :param epochs: Max number of epochs to train in each trial. Defaults to 1.
      If you have also set metric_threshold, a trial will stop if either it has been
      optimized to the metric_threshold or it has been trained for {epochs} epochs.
  :param validation_data: Validation data. Validation data type should be the same as data.
  :param metric: String or customized evaluation metric function.
      If string, metric is the evaluation metric name to optimize, e.g. "mse".
      If callable function, it signature should be func(y_true, y_pred), where y_true and
      y_pred are numpy ndarray. The function should return a float value as evaluation result.
  :param metric_mode: One of ["min", "max"]. "max" means greater metric value is better.
      You have to specify metric_mode if you use a customized metric function.
      You don't have to specify metric_mode if you use the built-in metric in
      bigdl.orca.automl.metrics.Evaluator.
  :param metric_threshold: a trial will be terminated when metric threshold is met
  :param n_sampling: Number of times to sample from the search_space. Defaults to 1.
      If hp.grid_search is in search_space, the grid will be repeated n_sampling of times.
      If this is -1, (virtually) infinite samples are generated
      until a stopping condition is met.
  :param search_space: a dict for search space
  :param search_alg: str, all supported searcher provided by ray tune
         (i.e."variant_generator", "random", "ax", "dragonfly", "skopt",
         "hyperopt", "bayesopt", "bohb", "nevergrad", "optuna", "zoopt" and
         "sigopt")
  :param search_alg_params: extra parameters for searcher algorithm besides search_space,
      metric and searcher mode
  :param scheduler: str, all supported scheduler provided by ray tune
  :param scheduler_params: parameters for scheduler
  :param feature_cols: feature column names if data is Spark DataFrame.
  :param label_cols: target column names if data is Spark DataFrame.
code: def fit(
      self,
      data: Union["partial", Tuple["ndarray", "ndarray"], "DataFrame"],
      epochs: int = 1,
      validation_data: Optional[
          Union["partial", Tuple["ndarray", "ndarray"], "DataFrame"]
      ] = None,
      metric: Optional[Union[Callable, str]] = None,
      metric_mode: Optional[str] = None,
      metric_threshold: Optional[Union["float", "int"]] = None,
      n_sampling: int = 1,
      search_space: Optional[Dict] = None,
      search_alg: Optional[str] = None,
      search_alg_params: Optional[Dict] = None,
      scheduler: Optional[str] = None,
      scheduler_params: Optional[Dict] = None,
      feature_cols: Optional[List[str]] = None,
      label_cols: Optional[List[str]] = None,
  ) -> None:
      """
      Automatically fit the model and search for the best hyperparameters.
  
      :param data: A Spark DataFrame, a tuple of ndarrays or a function.
          If data is a tuple of ndarrays, it should be in the form of (x, y),
          where x is training input data and y is training target data.
          If data is a function, it should takes config as argument and returns a tuple of
          ndarrays in the form of (x, y).
      :param epochs: Max number of epochs to train in each trial. Defaults to 1.
          If you have also set metric_threshold, a trial will stop if either it has been
          optimized to the metric_threshold or it has been trained for {epochs} epochs.
      :param validation_data: Validation data. Validation data type should be the same as data.
      :param metric: String or customized evaluation metric function.
          If string, metric is the evaluation metric name to optimize, e.g. "mse".
          If callable function, it signature should be func(y_true, y_pred), where y_true and
          y_pred are numpy ndarray. The function should return a float value as evaluation result.
      :param metric_mode: One of ["min", "max"]. "max" means greater metric value is better.
          You have to specify metric_mode if you use a customized metric function.
          You don't have to specify metric_mode if you use the built-in metric in
          bigdl.orca.automl.metrics.Evaluator.
      :param metric_threshold: a trial will be terminated when metric threshold is met
      :param n_sampling: Number of times to sample from the search_space. Defaults to 1.
          If hp.grid_search is in search_space, the grid will be repeated n_sampling of times.
          If this is -1, (virtually) infinite samples are generated
          until a stopping condition is met.
      :param search_space: a dict for search space
      :param search_alg: str, all supported searcher provided by ray tune
             (i.e."variant_generator", "random", "ax", "dragonfly", "skopt",
             "hyperopt", "bayesopt", "bohb", "nevergrad", "optuna", "zoopt" and
             "sigopt")
      :param search_alg_params: extra parameters for searcher algorithm besides search_space,
          metric and searcher mode
      :param scheduler: str, all supported scheduler provided by ray tune
      :param scheduler_params: parameters for scheduler
      :param feature_cols: feature column names if data is Spark DataFrame.
      :param label_cols: target column names if data is Spark DataFrame.
      """
      (
          data,
          validation_data,
          feature_cols,
          label_cols,
      ) = _merge_cols_for_spark_df(
          data, validation_data, feature_cols, label_cols
      )
  
      super().fit(
          data=data,
          epochs=epochs,
          validation_data=validation_data,
          metric=metric,
          metric_mode=metric_mode,
          metric_threshold=metric_threshold,
          n_sampling=n_sampling,
          search_space=search_space,
          search_alg=search_alg,
          search_alg_params=search_alg_params,
          scheduler=scheduler,
          scheduler_params=scheduler_params,
          feature_cols=feature_cols,
          label_cols=label_cols,
      )
  
file_path: BigDL/python/orca/src/bigdl/orca/automl/xgboost/auto_xgb.py
imports: from bigdl.orca.automl.xgboost.XGBoost import XGBoostModelBuilder
  from bigdl.orca.automl.auto_estimator import AutoEstimator
  from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union
label_desc: Use image node_id 2 for calling the AutoXGBRegressor obj's underlying member method code with example usage: obj.fit(data, epochs, validation_data, metric, metric_mode, metric_threshold, n_sampling, search_space, search_alg, search_alg_params, scheduler, scheduler_params, feature_cols, label_cols) without return types