code: def init(
      self,
      y,
      sample_weight,
      weighted_n_samples,
      sample_indices,
      start,
      end,
  ):
      self.y = y
      self.sample_weight = sample_weight
      self.sample_indices = sample_indices
      self.start = start
      self.end = end
      self.n_node_samples = end - start
      self.weighted_n_samples = weighted_n_samples
      self.weighted_n_node_samples = 0.0
      w = 1.0
  
      for k in range(self.n_outputs):
          n_cls = ivy.to_scalar(self.n_classes[k])
          self.sum_total[k, :n_cls] = 0
  
      for p in range(start, end):
          i = sample_indices[p]
          if sample_weight is not None:
              w = sample_weight[i]
          for k in range(self.n_outputs):
              c = int(self.y[i, k])
              self.sum_total[k, c] += w
  
          self.weighted_n_node_samples += w
  
      self.reset()
      return 0
  
imports: from abc import ABC, abstractmethod
  import ivy
label_desc: Use image node_id 2 for calling the ClassificationCriterion obj's underlying member method code with example usage: obj.init(y, sample_weight, weighted_n_samples, sample_indices, start, end) and returns: int