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

    https://github.com/apache/spark/pull/12938#discussion_r64703161
  
    --- Diff: python/pyspark/ml/classification.py ---
    @@ -154,7 +157,10 @@ def setThreshold(self, value):
         @since("1.4.0")
         def getThreshold(self):
             """
    -        Gets the value of threshold or its default value.
    +        Gets the value of threshold or attempt to convert thresholds to 
threshold if set, or default
    --- End diff --
    
    I just noticed that both this and Scala doc is inaccurate.
    
    Scala side says:
    ```
       * Get threshold for binary classification.
       *
       * If [[threshold]] is set, returns that value.
       * Otherwise, if [[thresholds]] is set with length 2 (i.e., binary 
classification),
       * this returns the equivalent threshold: {{{1 / (1 + thresholds(0) / 
thresholds(1))}}}.
       * Otherwise, returns [[threshold]] default value.
    ```
    
    But actually, the logic is "if thresholds is set and is length 2, return 1 
/ (1 + t(0) / t(1) ). Otherwise return threshold or its default value."
    
    Seems to me we should update both Scala and Python doc to reflect this.


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