class_docstr: ```
  Abstract class used to tune and train Keras models. The fit method is
  an abstract method and must be implemented by subclasses.
  ```
class_docstr_tok: ["``","`","Abstract","class","used","to","tune","and","train","Keras","models",".","The","fit","method","is","an","abstract","method","and","must","be","implemented","by","subclasses",".","``","`"]
code: def _cb_earlystopping(self, early_stopping, callbacks=[]):
      if callbacks and "EarlyStopping" in [
          type(cb).__name__ for cb in callbacks
      ]:
          return callbacks
      if early_stopping:
          if not isinstance(callbacks, list):
              callbacks = []
          # if StrictVersion(keras.__version__) >= StrictVersion('2.2.3'):
          try:
              callbacks.append(
                  keras.callbacks.EarlyStopping(
                      monitor="val_loss",
                      min_delta=0,
                      patience=early_stopping,
                      restore_best_weights=True,
                      verbose=0,
                      mode="auto",
                  )
              )
          except TypeError:
              warnings.warn(
                  """
                                The early_stopping=True argument relies on EarlyStopping.restore_best_weights,
                                which is only supported on Keras 2.2.3 or greater.
                                For now, we are falling back to EarlyStopping.restore_best_weights=False.
                                Please use checkpoint_folder option in fit() to restore best weights."""
              )
              callbacks.append(
                  keras.callbacks.EarlyStopping(
                      monitor="val_loss",
                      min_delta=0,
                      patience=early_stopping,
                      verbose=0,
                      mode="auto",
                  )
              )
  
      if not callbacks:
          callbacks = None
      return callbacks
  
imports: from .None import utils
  from .graph.predictor import LinkPredictor, NodePredictor
  from .graph.preprocessor import LinkPreprocessor, NodePreprocessor
  from .imports import *
  from .lroptimize.lrfinder import *
  from .tabular.predictor import TabularPredictor
  from .tabular.preprocessor import TabularPreprocessor
  from .text.ner.predictor import NERPredictor
  from .text.ner.preprocessor import NERPreprocessor
  from .text.predictor import TextPredictor
  from .text.preprocessor import BERTPreprocessor, TextPreprocessor, TransformersPreprocessor
  from .vision.predictor import ImagePredictor
  from .vision.preprocessor import ImagePreprocessor
label_desc: Use image node_id 29 for calling the Learner obj's underlying member method code with example usage: obj._cb_earlystopping(early_stopping, callbacks) and returns: callbacks, callbacks