class_docstr: A helper class that implements cutoff checks based on number of
  iterations and log likelihood.
  
  Accuracy cutoffs are also implemented, but they're almost never
  a good idea to use.
code: def check(self, classifier, train_toks):
      cutoffs = self.cutoffs
      self.iter += 1
      if "max_iter" in cutoffs and self.iter >= cutoffs["max_iter"]:
          return True  # iteration cutoff.
  
      new_ll = nltk.classify.util.log_likelihood(classifier, train_toks)
      if math.isnan(new_ll):
          return True
  
      if "min_ll" in cutoffs or "min_lldelta" in cutoffs:
          if "min_ll" in cutoffs and new_ll >= cutoffs["min_ll"]:
              return True  # log likelihood cutoff
          if (
              "min_lldelta" in cutoffs
              and self.ll
              and ((new_ll - self.ll) <= abs(cutoffs["min_lldelta"]))
          ):
              return True  # log likelihood delta cutoff
          self.ll = new_ll
  
      if "max_acc" in cutoffs or "min_accdelta" in cutoffs:
          new_acc = nltk.classify.util.log_likelihood(
              classifier, train_toks
          )
          if "max_acc" in cutoffs and new_acc >= cutoffs["max_acc"]:
              return True  # log likelihood cutoff
          if (
              "min_accdelta" in cutoffs
              and self.acc
              and ((new_acc - self.acc) <= abs(cutoffs["min_accdelta"]))
          ):
              return True  # log likelihood delta cutoff
          self.acc = new_acc
  
          return False
  
file_path: nltk/nltk/classify/util.py
imports: import math
  import nltk.classify.util
  from nltk.util import LazyMap
label_desc: Use image node_id 2 for calling the CutoffChecker obj's underlying member method code with example usage: obj.check(classifier, train_toks) and returns: True, True, False, True, True, True, True