docstr: Compute the loss of the node.
  
  Parameters
  ----------
  y
      A given class of the problem.
  dirichlet
      Dirichlet parameter of the problem.
  n_classes
      The total number of classes of the problem.
docstr_tok: ["Compute","the","loss","of","the","node",".","Parameters","--","--","--","--","--","y","A","given","class","of","the","problem",".","dirichlet","Dirichlet","parameter","of","the","problem",".","n_classes","The","total","number","of","classes","of","the","problem","."]
code: def loss(
      self, y: base.typing.ClfTarget, dirichlet: float, n_classes: int
  ) -> float:
      """Compute the loss of the node.
  
      Parameters
      ----------
      y
          A given class of the problem.
      dirichlet
          Dirichlet parameter of the problem.
      n_classes
          The total number of classes of the problem.
  
      """
  
      sc = self.score(y, dirichlet, n_classes)
      return -math.log(sc)
  
imports: from __future__ import annotations
  import collections
  import math
  from river import base, stats
  from river.tree.base import Branch, Leaf
  from river.utils.math import log_sum_2_exp
label_desc: Use image node_id 5 for calling the MondrianNodeClassifier obj's underlying member method code with example usage: obj.loss(y, dirichlet, n_classes) and returns: unknown