class_docstr: A node in a shadow tree. Each node has left and right pointers to child nodes, if any.
  As part of tree construction process, the samples examined at each decision node or at each leaf node are
  saved into field node_samples.
class_docstr_tok: ["A","node","in","a","shadow","tree",".","Each","node","has","left","and","right","pointers","to","child","nodes",",","if","any",".","As","part","of","tree","construction","process",",","the","samples","examined","at","each","decision","node","or","at","each","leaf","node","are","saved","into","field","node_samples","."]
docstr: If this tree model is a classifier, return a list with the count associated with each class.
docstr_tok: ["If","this","tree","model","is","a","classifier",",","return","a","list","with","the","count","associated","with","each","class","."]
code: def class_counts(self) -> (List[int], None):
      """
      If this tree model is a classifier, return a list with the count associated with each class.
      """
      if self.isclassifier():
          if self.shadow_tree.get_class_weight() is None:
              return np.array(
                  np.round(
                      self.shadow_tree.get_node_nsamples_by_class(
                          self.id
                      )
                  ),
                  dtype=int,
              )
          else:
              return np.round(
                  self.shadow_tree.get_node_nsamples_by_class(self.id)
                  / self.shadow_tree.get_class_weights()
              ).astype(int)
      return None
  
imports: from abc import ABC, abstractmethod
  from numbers import Number
  from typing import List, Tuple, Mapping
  import numpy
  import pandas
  import sklearn
  from dtreeviz import utils
label_desc: Use image node_id 15 for calling the ShadowDecTreeNode obj's underlying member method code with example usage: obj.class_counts() and returns: None, np, np