original_docstring: Train multiple datasets (regression problem) under multiple
      scikit-learn implementations.
  
      :param y_desired_index: the index of the datasset to retrieve an instance
          to test. Default is 1.
      :type y_desired_index: Integer
      :param verbose: define the verbosity. Default is False.
      :type verbose: Boolean
      
      :return: an array containing the results found. Each row includes the 
          dataset used, the algorithm used, the Pareto front, the Pareto set
          (i.e. the counterfactual variables) and the multiobjective optimization
          algorithm responsible of each counterfactual, respectively.
      :rtype: np.array
      
docstring: Train multiple datasets (regression problem) under multiple
  scikit-learn implementations.
docstring_tokens: Train multiple datasets ( regression problem ) under multiple scikit - learn implementations .
code: def train_regression(y_desired_index=1, verbose=False):
      """Train multiple datasets (regression problem) under multiple
      scikit-learn implementations.
  
      :param y_desired_index: the index of the datasset to retrieve an instance
          to test. Default is 1.
      :type y_desired_index: Integer
      :param verbose: define the verbosity. Default is False.
      :type verbose: Boolean
      
      :return: an array containing the results found. Each row includes the 
          dataset used, the algorithm used, the Pareto front, the Pareto set
          (i.e. the counterfactual variables) and the multiobjective optimization
          algorithm responsible of each counterfactual, respectively.
      :rtype: np.array
      """
      datasets = ['boston', 'diabetes', 'california']
      algorithms = ['AdaBoostRegressor', 'ExtraTreesRegressor', 
                    'GradientBoostingRegressor', 'RandomForestRegressor',
                    'DecisionTreeRegressor', 'LinearSVR', 'Ridge', 
                    'SGDRegressor', 'Lasso', 'KNeighborsRegressor', 
                    'RadiusNeighborsRegressor', 'RandomForestRegressor']
      trained_models = []
      
      for dataset in datasets:
          if verbose:
              print(f'Retrieving the dataset {dataset}')
          
          # Setting the sample index to be returned from the database
          y_desired_index = 1
          
          # Loading the database (in order to train the model) and 
          # required additional metadata on the sample in order to generate
          # the contrafactuals
          X, y, X_current, y_desired, immutable_column_indexes, \
              upper_bounds, lower_bounds, y_acceptable_range, \
              categorical_columns, integer_columns = \
                  load_sample_from_dataset(y_desired_index, dataset)
          
          # Training a ML model
          for algorithm in algorithms:
              if verbose:
                  print(f'Training using {algorithm}')
              
              model = train_ml_model(X, y, algorithm)
              
              if verbose:
                  print(f'Starting counterfactual generation.')
                  
              pareto_front, pareto_set, pareto_algorithms = \
                  generate_counterfactuals_regression(model, X_current, \
                      y_desired, immutable_column_indexes, y_acceptable_range, \
                      upper_bounds, lower_bounds, categorical_columns, \
                      integer_columns, n_gen=50, pop_size=300, \
                      max_changed_vars=10, verbose=verbose, seed=0)
                  
              trained_models.append([dataset, algorithm, pareto_front,
                                     pareto_set, pareto_algorithms])
      
      return np.array(trained_models)
code_tokens: def train_regression ( y_desired_index = 1 , verbose = False ) : datasets = [ 'boston' , 'diabetes' , 'california' ] algorithms = [ 'AdaBoostRegressor' , 'ExtraTreesRegressor' , 'GradientBoostingRegressor' , 'RandomForestRegressor' , 'DecisionTreeRegressor' , 'LinearSVR' , 'Ridge' , 'SGDRegressor' , 'Lasso' , 'KNeighborsRegressor' , 'RadiusNeighborsRegressor' , 'RandomForestRegressor' ] trained_models = [ ] for dataset in datasets : if verbose : print ( f'Retrieving the dataset {dataset}' ) y_desired_index = 1 X , y , X_current , y_desired , immutable_column_indexes , upper_bounds , lower_bounds , y_acceptable_range , categorical_columns , integer_columns = load_sample_from_dataset ( y_desired_index , dataset ) for algorithm in algorithms : if verbose : print ( f'Training using {algorithm}' ) model = train_ml_model ( X , y , algorithm ) if verbose : print ( f'Starting counterfactual generation.' ) pareto_front , pareto_set , pareto_algorithms = generate_counterfactuals_regression ( model , X_current , y_desired , immutable_column_indexes , y_acceptable_range , upper_bounds , lower_bounds , categorical_columns , integer_columns , n_gen = 50 , pop_size = 300 , max_changed_vars = 10 , verbose = verbose , seed = 0 ) trained_models . append ( [ dataset , algorithm , pareto_front , pareto_set , pareto_algorithms ] ) return np . array ( trained_models )
short_docstring: Train multiple datasets (regression problem) under multiple
  scikit-learn implementations.
short_docstring_tokens: Train multiple datasets ( regression problem ) under multiple scikit - learn implementations .
comment: """Train multiple datasets (regression problem) under multiple
      scikit-learn implementations.
  
      :param y_desired_index: the index of the datasset to retrieve an instance
          to test. Default is 1.
      :type y_desired_index: Integer
      :param verbose: define the verbosity. Default is False.
      :type verbose: Boolean
      
      :return: an array containing the results found. Each row includes the 
          dataset used, the algorithm used, the Pareto front, the Pareto set
          (i.e. the counterfactual variables) and the multiobjective optimization
          algorithm responsible of each counterfactual, respectively.
      :rtype: np.array
      """$SEP$# Setting the sample index to be returned from the database$SEP$# Loading the database (in order to train the model) and $SEP$# required additional metadata on the sample in order to generate$SEP$# the contrafactuals$SEP$# Training a ML model