class_docstr: Absolute loss, also known as the mean absolute error or L1 loss.
  
  Mathematically, it is defined as
  
  $$L = |p_i - y_i|$$
  
  It's gradient w.r.t. to $p_i$ is
  
  $$\frac{\partial L}{\partial p_i} = sgn(p_i - y_i)$$
  
  Examples
  --------
  
  >>> from river import optim
  
  >>> loss = optim.losses.Absolute()
  >>> loss(-42, 42)
  84
  >>> loss.gradient(1, 2)
  1
  >>> loss.gradient(2, 1)
  -1
class_docstr_tok: ["Absolute","loss",",","also","known","as","the","mean","absolute","error","or","L1","loss",".","Mathematically",",","it","is","defined","as","$","$","L","=","|p_i","-","y_i|","$","$","It","'s","gradient","w.r.t",".","to","$","p_i","$","is","$","$","\\frac","{","\\partial","L","}","{","\\partial","p_i","}","=","sgn","(","p_i","-","y_i",")","$","$","Examples","--","--","--","--",">",">",">","from","river","import","optim",">",">",">","loss","=","optim.losses.Absolute","(",")",">",">",">","loss","(","-42",",","42",")","84",">",">",">","loss.gradient","(","1",",","2",")","1",">",">",">","loss.gradient","(","2",",","1",")","-1"]
code: def __call__(self, y_true, y_pred):
      if isinstance(y_true, np.ndarray):
          return np.abs(y_pred - y_true)
      return abs(y_pred - y_true)
  
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 1 for calling the Absolute obj's underlying member method code with example usage: obj.__call__(y_true, y_pred) and returns: abs, np