class_docstr: Multiclass generalization of the logarithmic loss.
  
  Examples
  --------
  
  >>> from river import metrics
  
  >>> y_true = [0, 1, 2, 2]
  >>> y_pred = [
  ...     {0: 0.29450637, 1: 0.34216758, 2: 0.36332605},
  ...     {0: 0.21290077, 1: 0.32728332, 2: 0.45981591},
  ...     {0: 0.42860913, 1: 0.33380113, 2: 0.23758974},
  ...     {0: 0.44941979, 1: 0.32962558, 2: 0.22095463}
  ... ]
  
  >>> metric = metrics.CrossEntropy()
  
  >>> for yt, yp in zip(y_true, y_pred):
  ...     metric.update(yt, yp)
  ...     print(metric.get())
  1.222454
  1.169691
  1.258864
  1.321597
  
  >>> metric
  CrossEntropy: 1.321598
code: def _eval(self, y_true, y_pred):
      total = 0
  
      for label, proba in y_pred.items():
          if y_true == label:
              total += math.log(
                  utils.math.clamp(
                      x=proba, minimum=1e-15, maximum=1 - 1e-15
                  )
              )
  
      return -total
  
file_path: river/river/metrics/cross_entropy.py
imports: from __future__ import annotations
  import math
  from river import metrics, utils
label_desc: Use image node_id 3 for calling the CrossEntropy obj's underlying member method code with example usage: obj._eval(y_true, y_pred) and returns: unknown