code: def __init__(self, params):
      super(EarlyStopping, self).__init__(params)
      self.name = params.get("name", "early_stopping")
      self.metric = Metric(params.get("metric"))
      self.max_no_improvement_cnt = params.get(
          "max_no_improvement_cnt", 5
      )
      self.log_to_dir = params.get("log_to_dir")
  
      self.keep_best_model = params.get("keep_best_model", True)
      self.best_iter = {}
      self.best_loss = {}
      self.loss_values = {}
      self.best_models = {}
      self.best_y_predicted = {}
      self.best_y_oof = None  # predictions computed on out of folds or on validation set
      self.final_loss = None  # final score computed on combined predictions from all learners
      # path to best model local copy, only used if cannot deep copy
      self.best_model_paths = {}
      self.multiple_target = False
      self.target_columns = None
  
file_path: mljar-supervised/supervised/callbacks/early_stopping.py
imports: import logging
  import os
  import numpy
  import pandas
  from supervised.callbacks.callback import Callback
  from supervised.utils.config import LOG_LEVEL
  from supervised.utils.metric import Metric
  from supervised.utils.config import mem
label_desc: Use image node_id 1 to create a new EarlyStopping object from inherited base classes: Callback with example: obj = EarlyStopping(params)