code: def train_regressor(regressor_name, data, **kwargs):
      """Train regressor model
  
      Parameters
      ----------
      model: str
          Name of the regression model to use. Can be one of
          - AdaBoostRegressor
          - BaggingRegressor
          - ExtraTreesRegressor
          - GradientBoostingRegressor
          - RandomForestRegressor (Default)
      trials: DataFrame or dict
          A dataframe of trials containing, at least, the columns 'objective' and 'id'. Or a dict
          equivalent.
  
      **kwargs
          Arguments for the regressor model.
  
      """
      if regressor_name not in _regressors_:
          raise ValueError(
              f"{regressor_name} is not a supported regressor. "
              f"Did you mean any of thesis: list(_regressors_.keys())"
          )
  
      regressor = _regressors_[regressor_name](**kwargs)
      return regressor.fit(data[:, :-1], data[:, -1])
  
file_path: orion/src/orion/analysis/base.py
imports: import itertools
  from functools import reduce
  import numpy
  import pandas
  from sklearn.ensemble import AdaBoostRegressor, BaggingRegressor, ExtraTreesRegressor, GradientBoostingRegressor, RandomForestRegressor
  from orion.core.utils import format_trials
  from orion.core.worker.transformer import build_required_space
label_desc: Use image node_id 6 for calling a global function with example usage: train_regressor(regressor_name, data) and returns: regressor