class_docstr: A stopping criterion which measures the agreement between sets of predictions [BV09]_.
  
  .. versionchanged:: 1.3.3
     The previous implementation, which was flawed, has been corrected.
docstr: num_classes : int
      Number of classes.
  window_size : int, default=3
      Defines number of iterations for which the predictions are taken into account, i.e.
      this stopping criterion only sees the last `window_size`-many states of the prediction
      array passed to `stop()`.
  kappa : float, default=0.99
      The criterion stops when the agreement between two consecutive predictions within
      the window falls below this threshold.
docstr_tok: ["num_classes",":","int","Number","of","classes",".","window_size",":","int",",","default=3","Defines","number","of","iterations","for","which","the","predictions","are","taken","into","account",",","i.e",".","this","stopping","criterion","only","sees","the","last","`","window_size","`","-many","states","of","the","prediction","array","passed","to","`","stop","(",")","`",".","kappa",":","float",",","default=0.99","The","criterion","stops","when","the","agreement","between","two","consecutive","predictions","within","the","window","falls","below","this","threshold","."]
code: def __init__(self, num_classes, window_size=3, kappa=0.99):
      """
      num_classes : int
          Number of classes.
      window_size : int, default=3
          Defines number of iterations for which the predictions are taken into account, i.e.
          this stopping criterion only sees the last `window_size`-many states of the prediction
          array passed to `stop()`.
      kappa : float, default=0.99
          The criterion stops when the agreement between two consecutive predictions within
          the window falls below this threshold.
      """
      self.num_classes = num_classes
      self.window_size = window_size
      self.kappa = kappa
  
      self.last_predictions = None
      self.kappa_history = []
  
imports: import numpy
  from sklearn.metrics import cohen_kappa_score
  from small_text.stopping_criteria.base import StoppingCriterion, check_window_based_predictions
label_desc: Use image node_id 1 to create a new KappaAverage object from inherited base classes: StoppingCriterion with example: obj = KappaAverage(num_classes, window_size, kappa)