class_docstr: Logarithmic loss.
  
  This loss function expects each provided `y_pred` to be a logit. In other words if must be
  the raw output of a linear model or a neural network.
  
  Parameters
  ----------
  weight_pos
  weight_neg
  
  References
  ----------
  [^1]: [Logit Wikipedia page](https://www.wikiwand.com/en/Logit>)
class_docstr_tok: ["Logarithmic","loss",".","This","loss","function","expects","each","provided","`","y_pred","`","to","be","a","logit",".","In","other","words","if","must","be","the","raw","output","of","a","linear","model","or","a","neural","network",".","Parameters","--","--","--","--","--","weight_pos","weight_neg","References","--","--","--","--","--","[","^1","]",":","[","Logit","Wikipedia","page","]","(","https",":","\/\/www.wikiwand.com\/en\/Logit",">",")"]
code: def __call__(self, y_true, y_pred):
      if isinstance(y_true, np.ndarray):
          weights = np.where(
              y_true == 0, self.weight_neg, self.weight_pos
          )
          y_true = 2 * y_true - 1  # map {0, 1} to {-1, 1}
          z = y_pred * y_true
          return weights * np.log(1.0 + np.exp(-z))
  
      weight = self.weight_pos
      if y_true == 0:
          y_true = -1
          weight = self.weight_neg
      else:
          y_true = int(y_true)
  
      z = y_pred * y_true
      if z > 18.0:
          return weight * math.exp(-z)
      if z < -18.0:
          return weight * -z
      return weight * math.log(1.0 + math.exp(-z))
  
imports: from __future__ import annotations
  import math
  import numpy
  from scipy import special
  from river import base, utils
  from river.optim.base import Loss
label_desc: Use image node_id 2 for calling the Log obj's underlying member method code with example usage: obj.__call__(y_true, y_pred) and returns: unknown, unknown, unknown, unknown