Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5330#discussion_r27700311
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/tree/loss/LogLoss.scala ---
    @@ -39,17 +39,15 @@ object LogLoss extends Loss {
        * Method to calculate the loss gradients for the gradient boosting 
calculation for binary
        * classification
        * The gradient with respect to F(x) is: - 4 y / (1 + exp(2 y F(x)))
    -   * @param model Ensemble model
    -   * @param point Instance of the training dataset
    +   * @param prediction Predicted point
    +   * @param label True label.
        * @return Loss gradient
        */
    -  override def gradient(
    -      model: TreeEnsembleModel,
    -      point: LabeledPoint): Double = {
    -    val prediction = model.predict(point.features)
    -    - 4.0 * point.label / (1.0 + math.exp(2.0 * point.label * prediction))
    +  override def gradient(prediction: Double, label: Double): Double = {
    +    - 4.0 * label / (1.0 + math.exp(2.0 * label * prediction))
       }
     
    +
    --- End diff --
    
    Remove extra newline


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to