class_docstr: Categorical cross-entropy loss, for multiclass classification.
  
  Domain:
  y_true in {0, 1, 2, 3, .., n_classes - 1}
  y_pred has n_classes elements, each element in (0, 1)
  
  Link:
  y_pred = softmax(raw_prediction)
  
  Note: We assume y_true to be already label encoded. The inverse link is
  softmax. But the full link function is the symmetric multinomial logit
  function.
  
  For a given sample x_i, the categorical cross-entropy loss is defined as
  the negative log-likelihood of the multinomial distribution, it
  generalizes the binary cross-entropy to more than 2 classes::
  
      loss_i = log(sum(exp(raw_pred_{i, k}), k=0..n_classes-1))
              - sum(y_true_{i, k} * raw_pred_{i, k}, k=0..n_classes-1)
  
  See [1].
  
  Note that for the hessian, we calculate only the diagonal part in the
  classes: If the full hessian for classes k and l and sample i is H_i_k_l,
  we calculate H_i_k_k, i.e. k=l.
  
  Reference
  ---------
  .. [1] :arxiv:`Simon, Noah, J. Friedman and T. Hastie.
      "A Blockwise Descent Algorithm for Group-penalized Multiresponse and
      Multinomial Regression".
      <1311.6529>`
class_docstr_tok: ["Categorical","cross-entropy","loss",",","for","multiclass","classification",".","Domain",":","y_true","in","{","0",",","1",",","2",",","3",",","..",",","n_classes","-","1","}","y_pred","has","n_classes","elements",",","each","element","in","(","0",",","1",")","Link",":","y_pred","=","softmax","(","raw_prediction",")","Note",":","We","assume","y_true","to","be","already","label","encoded",".","The","inverse","link","is","softmax",".","But","the","full","link","function","is","the","symmetric","multinomial","logit","function",".","For","a","given","sample","x_i",",","the","categorical","cross-entropy","loss","is","defined","as","the","negative","log-likelihood","of","the","multinomial","distribution",",","it","generalizes","the","binary","cross-entropy","to","more","than","2","classes",":",":","loss_i","=","log","(","sum","(","exp","(","raw_pred_","{","i",",","k","}",")",",","k=0","..","n_classes-1",")",")","-","sum","(","y_true_","{","i",",","k","}","*","raw_pred_","{","i",",","k","}",",","k=0","..","n_classes-1",")","See","[","1","]",".","Note","that","for","the","hessian",",","we","calculate","only","the","diagonal","part","in","the","classes",":","If","the","full","hessian","for","classes","k","and","l","and","sample","i","is","H_i_k_l",",","we","calculate","H_i_k_k",",","i.e",".","k=l",".","Reference","--","--","--","--","-","..","[","1","]",":","arxiv",":","`","Simon",",","Noah",",","J.","Friedman","and","T.","Hastie",".","``","A","Blockwise","Descent","Algorithm","for","Group-penalized","Multiresponse","and","Multinomial","Regression","''",".","<","1311.6529",">","`"]
docstr: Predict probabilities.
  
  Parameters
  ----------
  raw_prediction : array of shape (n_samples, n_classes)
      Raw prediction values (in link space).
  
  Returns
  -------
  proba : array of shape (n_samples, n_classes)
      Element-wise class probabilities.
docstr_tok: ["Predict","probabilities",".","Parameters","--","--","--","--","--","raw_prediction",":","array","of","shape","(","n_samples",",","n_classes",")","Raw","prediction","values","(","in","link","space",")",".","Returns","--","--","--","-","proba",":","array","of","shape","(","n_samples",",","n_classes",")","Element-wise","class","probabilities","."]
code: def predict_proba(self, raw_prediction):
      """Predict probabilities.
  
      Parameters
      ----------
      raw_prediction : array of shape (n_samples, n_classes)
          Raw prediction values (in link space).
  
      Returns
      -------
      proba : array of shape (n_samples, n_classes)
          Element-wise class probabilities.
      """
      return self.link.inverse(raw_prediction)
  
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 4 for calling the HalfMultinomialLoss obj's underlying member method code with example usage: obj.predict_proba(raw_prediction) and returns: self