class_docstr: This class provides a nice interface to easily use the
  ControlledAutoML class and the metaopt module in general.
  
  It is a wrapper around the :class:`ControlledAutoML` class, which is a wrapper around
  the AutoML loop contained in the :class:`BaseControllerLoop` class
  and the :class:`Trainer` class all contained in this module.
  
  :param pipeline: pipeline to copy and use for training
  :param validation_splitter: validation splitter to use
  :param refit_best_trial: whether to refit the best model on the whole dataset after the optimization
  :param scoring_callback: main callback to use for scoring, that is deprecated
  :param hyperparams_optimizer: hyperparams optimizer to use
  :param hyperparams_repository: hyperparams repository to use
  :param n_trials: number of trials to run
  :param epochs: number of epochs to train the model for each val split
  :param callbacks: callbacks to use for training - there can be aditionnal metrics there
  :param n_jobs: number of jobs to use for parallelization, defaults is None for no parallelization
  :param continue_loop_on_error: whether to continue the main optimization loop on error or not
  :return: AutoML object ready to use with fit and transform.
code: def __init__(
      self,
      pipeline: BaseStep,
      validation_splitter: "BaseValidationSplitter" = None,
      hyperparams_optimizer: BaseHyperparameterOptimizer = None,
      scoring_callback: ScoringCallback = None,
      callbacks: List[BaseCallback] = None,
      hyperparams_repository: HyperparamsRepository = None,
      n_trials: int = None,
      refit_best_trial: bool = True,
      start_new_round=True,
      epochs: int = 1,
      n_jobs=1,
      continue_loop_on_error=True,
  ):
      # parse or guess args:
      validation_splitter = validation_splitter or ValidationSplitter(
          0.2
      )
      hyperparams_optimizer = (
          hyperparams_optimizer or GridExplorationSampler()
      )
  
      callbacks = list(callbacks) if callbacks is not None else []
      if scoring_callback is not None:
          callbacks = [scoring_callback] + callbacks
      if len(callbacks) == 0:
          raise ValueError("At least one callback must be provided.")
      if not isinstance(callbacks[0], MetricCallback):
          raise ValueError(
              "The first callback is the scoring callback and it must be a MetricCallback."
          )
  
      if n_trials is None or n_trials < 1:
          n_trials: int = (
              GridExplorationSampler.estimate_ideal_n_trials(
                  pipeline.get_hyperparams_space()
              )
          )
  
      # init subservices:
      trainer = Trainer(
          callbacks=callbacks,
          validation_splitter=validation_splitter,
          n_epochs=epochs,
      )
      controller_loop = DefaultLoop(
          trainer=trainer,
          n_trials=n_trials,
          n_jobs=n_jobs,
          hp_optimizer=hyperparams_optimizer,
          continue_loop_on_error=continue_loop_on_error,
      )
  
      # init base class:
      ControlledAutoML.__init__(
          self,
          pipeline=pipeline,
          loop=controller_loop,
          repo=hyperparams_repository,
          main_metric_name=callbacks[0].name,
          start_new_round=start_new_round,
          refit_best_trial=refit_best_trial,
      )
  
imports: import gc
  from copy import copy
  from typing import ContextManager, Iterator, List, Optional, Tuple
  from neuraxle.base import CX, BaseService, BaseStep, BaseStepT, ExecutionContext, ExecutionMode, ForceHandleMixin, TruncableService, _HasChildrenMixin
  from neuraxle.data_container import ARG_X_INPUTTED, IDT
  from neuraxle.data_container import DataContainer
  from neuraxle.data_container import TrainDACT
  from neuraxle.hyperparams.space import HyperparameterSpace
  from neuraxle.metaopt.callbacks import ARG_Y_EXPECTED, ARG_Y_PREDICTD, BaseCallback, CallbackList, MetricCallback, ScoringCallback
  from neuraxle.metaopt.context import AutoMLContext
  from neuraxle.metaopt.data.aggregates import Client, Project, Root, Round, Trial, TrialSplit
  from neuraxle.metaopt.data.reporting import RoundReport
  from neuraxle.metaopt.data.vanilla import DEFAULT_CLIENT, DEFAULT_PROJECT, RoundDataclass, ScopedLocation
  from neuraxle.metaopt.optimizer import BaseHyperparameterOptimizer, GridExplorationSampler, RandomSearchSampler
  from neuraxle.metaopt.repositories.repo import HyperparamsRepository
  from neuraxle.metaopt.validation import BaseValidationSplitter, ValidationSplitter
label_desc: Use image node_id 1 to create a new AutoML object from inherited base classes: ControlledAutoML with example: obj = AutoML(pipeline, validation_splitter, hyperparams_optimizer, scoring_callback, callbacks, hyperparams_repository, n_trials, refit_best_trial, start_new_round, epochs, n_jobs, continue_loop_on_error)