title: Which is the loss function for multi-class classification in XGBoost?
body: <p>I'm trying to know which loss function uses XGBoost for multi-class classification. I found <a href="https://stackoverflow.com/questions/39093683/how-is-the-gradient-and-hessian-of-logarithmic-loss-computed-in-the-custom-objec">in this question</a> the loss function for logistic classification in the binary case.</p>
  
  <p>I had though that for the multi-class case it might be the same as in GBM (for K classes) <a href="https://i.stack.imgur.com/evM6w.png" rel="noreferrer">which can be seen here</a>, where y_k=1 if x's label is k and 0 in any other case, and p_k(x) is the softmax function. However, I have made the first and second order gradient using this loss function and the hessian doesn't match the one defined in the code <a href="https://github.com/dmlc/xgboost/blob/master/src/objective/multiclass_obj.cu" rel="noreferrer">here</a> (in function GetGradient in SoftmaxMultiClassObj) by a constant 2.</p>
  
  <p>Could you please tell me which is the loss function used?</p>
  
  <p>Thank you in advance.</p>