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

    https://github.com/apache/spark/pull/16441#discussion_r94902030
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala ---
    @@ -248,12 +269,38 @@ class GBTClassificationModel private[ml](
         if (prediction > 0.0) 1.0 else 0.0
       }
     
    +  override protected def predictRaw(features: Vector): Vector = {
    --- End diff --
    
    I can see how my comment was confusing now :) Since GBT only supports two 
classes right now, we could override methods like `probability2prediction` 
which are by default calling what is implemented in `ProbabilisticClassifier`. 
That method loops through all the classes in a while loop, divides by the 
threshold and takes the largest one. Since we know we only have two classes 
here, we could instead do something faster, like
    
    ````scala
    if (probability(1) > getThreshold) 1 else 0
    ````


---
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