def xgb_score(loss, preds, labels):
    """
    According to xgboost scoring function
    score = 0.5* G**2 / (H+l2_regularization)
    """
    G = loss.grad(preds, labels).sum()
    H = loss.hess(preds, labels).sum()
    return 0.5 * (G ** 2) / (H + loss.l2_regularization)