class_docstr: Class used to train a pipeline using various data splits and callbacks for evaluation purposes.
  It loops on splits that the splitter yields, and on epochs as well, to train and validate the pipeline
  with the given metrics and other callbacks.
  
  If the predicted expected output of a pipeline's prediction dact is not empty, then it will be used
  in the metrics instead of using the fed dacts' expected output. This is to allow for the use of
  autoregressive models, where the expected output is not known at the time of sending it to the model at train-time, but is known for the least at validation time as per the validation splitter.
code: def __init__(
      self,
      validation_splitter: "BaseValidationSplitter",
      callbacks: List[BaseCallback] = None,
      n_epochs: int = 1,
  ):
      BaseService.__init__(self)
      self.validation_splitter: BaseValidationSplitter = (
          validation_splitter
      )
      self.callbacks: CallbackList = (
          CallbackList(callbacks) if callbacks is not None else []
      )
      self.n_epochs = n_epochs
  
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 Trainer object from inherited base classes: BaseService with example: obj = Trainer(validation_splitter, callbacks, n_epochs)