class_docstr: Cox Partial Likelihood
class_docstr_tok: ["Cox","Partial","Likelihood"]
docstr: Negative gradient of partial likelihood
  
  Parameters
  ---------
  y : tuple, len = 2
      First element is boolean event indicator and second element survival/censoring time.
  y_pred : np.ndarray, shape=(n,):
      The predictions.
docstr_tok: ["Negative","gradient","of","partial","likelihood","Parameters","--","--","--","--","-","y",":","tuple",",","len","=","2","First","element","is","boolean","event","indicator","and","second","element","survival\/censoring","time",".","y_pred",":","np.ndarray",",","shape=","(","n",",",")",":","The","predictions","."]
code: def negative_gradient(
      self, y, raw_predictions, sample_weight=None, **kwargs
  ):  # pylint: disable=unused-argument
      """Negative gradient of partial likelihood
  
      Parameters
      ---------
      y : tuple, len = 2
          First element is boolean event indicator and second element survival/censoring time.
      y_pred : np.ndarray, shape=(n,):
          The predictions.
      """
      ret = coxph_negative_gradient(
          y["event"].astype(np.uint8),
          y["time"],
          raw_predictions.ravel(),
      )
      if sample_weight is not None:
          ret *= sample_weight
      return ret
  
imports: from abc import ABCMeta
  import numpy
  from sklearn.dummy import DummyRegressor
  from sklearn.ensemble._gb_losses import RegressionLossFunction
  from sklearn.utils.extmath import squared_norm
  from ..nonparametric import ipc_weights
  from ._coxph_loss import coxph_loss, coxph_negative_gradient
label_desc: Use image node_id 2 for calling the CoxPH obj's underlying member method code with example usage: obj.negative_gradient(y, raw_predictions, sample_weight) and returns: ret