-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-15162][SPARK-15164][PySpark][DOCS][ML] update some pydocs #12938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
8389280
1fa57e5
b1ce817
8125c8c
c72fa46
3fd1dce
c7caa43
4776221
64942b7
2397004
130d05f
a73913b
50b41ae
9e38ddf
f4df8f0
5df5a93
2eec947
e11dbf8
4111b2d
53ab790
c2c7900
a7aadec
e4061f4
7b634b6
873f6c8
9fb2e41
74636b1
d925f38
3981612
3d13c6c
2be8cdf
4431daa
d842309
de63f9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…ce it doesn't throw an an error
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,7 +159,7 @@ def getThreshold(self): | |
| """ | ||
| Gets the value of threshold or attempt to convert thresholds to threshold if set, or default | ||
| value if neither are set. | ||
| This conversion is equivalent to: {{{1 / (1 + thresholds(0) / thresholds(1))}}}. | ||
| This conversion is equivalent to: :math:`\\frac{1}{1 + \\frac{thresholds(0)}{thresholds(1)}}`. | ||
| """ | ||
| self._checkThresholdConsistency() | ||
| if self.isSet(self.thresholds): | ||
|
|
@@ -188,7 +188,7 @@ def getThresholds(self): | |
| If :py:attr:`thresholds` is set, return its value. | ||
| Otherwise, if :py:attr:`threshold` is set, return the equivalent thresholds for binary | ||
| classification: (1-threshold, threshold). | ||
| If neither are set, throw an error. | ||
| If neither are set, return the default value. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If neither are explicitly set, it does in fact throw an error:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we should revert the doc ... ... but it does seem strange to me to throw that error. Why not if both are unset, use the default value for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably harmonize with the Scala side and return the default value yes?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say yeah - cc @yanboliang thoughts?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually now that I'm back from traveling I think reverting the doc change is the right thing to do since that is what the Scala side does (I misread it earlier).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok - we can revisit a change to behaviour in a separate PR |
||
| """ | ||
| self._checkThresholdConsistency() | ||
| if not self.isSet(self.thresholds) and self.isSet(self.threshold): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that both this and Scala doc is inaccurate.
Scala side says:
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I'll go and update both the docs.