Github user viirya commented on the pull request:

    https://github.com/apache/spark/pull/3899#issuecomment-68837277
  
    Hi @mengxr, Thanks for comment. I may be wrong, but I think that we should 
branch based on `sign(label)` instead of `sign(label * margin)`?
    
    Because according to the definition of logistic loss function, `log(1 + 
exp(-yp))`, where y = +1 for positive label and y = -1 for negative label. 
    
    When we branch on `sign(label * margin)`, we can not make sure what the 
sign of label is, right? Because when `sign(label * margin) == 1`, it could be 
`(sign(label), sign(margin)) == (1, 1)` or `(sign(label), sign(margin)) == (-1, 
-1)`.
    
    Besides, 
[https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/tree/loss/LogLoss.scala#L67](https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/tree/loss/LogLoss.scala#L67)
 and 
[https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/tree/loss/LogLoss.scala#L69](https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/tree/loss/LogLoss.scala#L69)
 are mathematically the same equation. I think it should be a bug. As the 
function note said, it is not used by the gradient boosting algorithm but only 
for debugging, so it is not found before.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to