class_docstr: Perform early stopping when there is multiple epochs in a row that didn't improve the performance of the model.
docstr: :param max_epochs_without_improvement: The number of step without improvement on the validation score before an early stopping is triggered.
  :param metric_name: The name of the metric on which we want to condition the early stopping. If None, the main metric will be used.
docstr_tok: [":","param","max_epochs_without_improvement",":","The","number","of","step","without","improvement","on","the","validation","score","before","an","early","stopping","is","triggered",".",":","param","metric_name",":","The","name","of","the","metric","on","which","we","want","to","condition","the","early","stopping",".","If","None",",","the","main","metric","will","be","used","."]
code: def __init__(self, max_epochs_without_improvement, metric_name=None):
      """
  
      :param max_epochs_without_improvement: The number of step without improvement on the validation score before an early stopping is triggered.
      :param metric_name: The name of the metric on which we want to condition the early stopping. If None, the main metric will be used.
      """
      self.n_epochs_without_improvement = max_epochs_without_improvement
      self.metric_name = None
  
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 1 to create a new EarlyStoppingCallback object from inherited base classes: BaseCallback with example: obj = EarlyStoppingCallback(max_epochs_without_improvement, metric_name)