class_docstr: Huber loss.
  
  Variant of the squared loss that is robust to outliers.
  
  Parameters
  ----------
  epsilon
  
  References
  ----------
  1. [Huber loss function - Wikipedia](https://en.wikipedia.org/wiki/Huber_Loss_Function)
class_docstr_tok: ["Huber","loss",".","Variant","of","the","squared","loss","that","is","robust","to","outliers",".","Parameters","--","--","--","--","--","epsilon","References","--","--","--","--","--","1",".","[","Huber","loss","function","-","Wikipedia","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Huber_Loss_Function",")"]
code: def __call__(self, y_true, y_pred):
      r = y_pred - y_true
  
      if isinstance(y_true, np.ndarray):
          abs_r = np.abs(r)
          return np.where(
              abs_r <= self.epsilon,
              0.5 * r * r,
              self.epsilon * abs_r
              - (0.5 * self.epsilon * self.epsilon),
          )
  
      abs_r = abs(r)
      if abs_r <= self.epsilon:
          return 0.5 * r * r
      return self.epsilon * abs_r - (0.5 * self.epsilon * self.epsilon)
  
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 Huber obj's underlying member method code with example usage: obj.__call__(y_true, y_pred) and returns: unknown, np, unknown