class_docstr: Quantile loss aka pinball loss, for regression.
  
  Domain:
  y_true and y_pred all real numbers
  quantile in (0, 1)
  
  Link:
  y_pred = raw_prediction
  
  For a given sample x_i, the pinball loss is defined as::
  
      loss(x_i) = rho_{quantile}(y_true_i - raw_prediction_i)
  
      rho_{quantile}(u) = u * (quantile - 1_{u<0})
                        = -u *(1 - quantile)  if u < 0
                           u * quantile       if u >= 0
  
  Note: 2 * PinballLoss(quantile=0.5) equals AbsoluteError().
  
  Additional Attributes
  ---------------------
  quantile : float
      The quantile level of the quantile to be estimated. Must be in range (0, 1).
class_docstr_tok: ["Quantile","loss","aka","pinball","loss",",","for","regression",".","Domain",":","y_true","and","y_pred","all","real","numbers","quantile","in","(","0",",","1",")","Link",":","y_pred","=","raw_prediction","For","a","given","sample","x_i",",","the","pinball","loss","is","defined","as",":",":","loss","(","x_i",")","=","rho_","{","quantile","}","(","y_true_i","-","raw_prediction_i",")","rho_","{","quantile","}","(","u",")","=","u","*","(","quantile","-","1_","{","u","<","0","}",")","=","-u","*","(","1","-","quantile",")","if","u","<","0","u","*","quantile","if","u",">","=","0","Note",":","2","*","PinballLoss","(","quantile=0.5",")","equals","AbsoluteError","(",")",".","Additional","Attributes","--","--","--","--","--","--","--","--","--","--","-","quantile",":","float","The","quantile","level","of","the","quantile","to","be","estimated",".","Must","be","in","range","(","0",",","1",")","."]
code: def __init__(self, sample_weight=None, quantile=0.5):
      check_scalar(
          quantile,
          "quantile",
          target_type=numbers.Real,
          min_val=0,
          max_val=1,
          include_boundaries="neither",
      )
      super().__init__(
          closs=CyPinballLoss(quantile=float(quantile)),
          link=IdentityLink(),
      )
      self.approx_hessian = True
      self.constant_hessian = sample_weight is None
  
imports: import numbers
  import numpy
  from scipy.special import xlogy
  from ..utils import check_scalar
  from ..utils.stats import _weighted_percentile
  from ._loss import CyAbsoluteError, CyExponentialLoss, CyHalfBinomialLoss, CyHalfGammaLoss, CyHalfMultinomialLoss, CyHalfPoissonLoss, CyHalfSquaredError, CyHalfTweedieLoss, CyHalfTweedieLossIdentity, CyHuberLoss, CyPinballLoss
  from .link import HalfLogitLink, IdentityLink, Interval, LogitLink, LogLink, MultinomialLogit
label_desc: Use image node_id 1 to create a new PinballLoss object from inherited base classes: BaseLoss with example: obj = PinballLoss(sample_weight, quantile)