class_docstr: Perform early stopping when there is multiple epochs in a row that didn't improve the performance of the model.
code: def call(
      self,
      trial_split: TrialSplit,
      dact_train: EvalEOTDACT,
      dact_valid: EvalEOTDACT,
      is_finished_and_fitted: bool = False,
  ) -> bool:
      metric_name = self.metric_name or trial_split.main_metric_name
      unmanaged_metric_results: MetricResults = (
          trial_split.metric_result(metric_name)
      )
      validation_scores = unmanaged_metric_results.get_valid_scores()
  
      if len(validation_scores) > self.n_epochs_without_improvement:
          higher_score_is_better = (
              unmanaged_metric_results.is_higher_score_better()
          )
          if (higher_score_is_better) and all(
              validation_scores[-self.n_epochs_without_improvement] >= v
              for v in validation_scores[
                  -self.n_epochs_without_improvement :
              ]
          ):
              return True
          elif (not higher_score_is_better) and all(
              validation_scores[-self.n_epochs_without_improvement] <= v
              for v in validation_scores[
                  -self.n_epochs_without_improvement :
              ]
          ):
              return True
      return False
  
imports: from abc import ABC, abstractmethod
  from typing import Callable, List, Optional
  from neuraxle.base import ExecutionContext
  from neuraxle.data_container import ARG_Y_EXPECTED, ARG_Y_PREDICTD, EvalEOTDACT
  from neuraxle.logging.warnings import warn_deprecated_class
  from neuraxle.metaopt.data.aggregates import MetricResults, TrialSplit
label_desc: Use image node_id 2 for calling the EarlyStoppingCallback obj's underlying member method code with example usage: obj.call(trial_split, dact_train, dact_valid, is_finished_and_fitted) and returns: False, True, True