-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-23162][PySpark][ML] Add r2adj into Python API in LinearRegressionSummary #20842
Conversation
ok to test |
Test build #88492 has finished for PR 20842 at commit
|
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.
Thanks @kevinyu98! Looks mostly good, just some small doc formatting issues
python/pyspark/ml/regression.py
Outdated
@since("2.4.0") | ||
def r2adj(self): | ||
""" | ||
Returns Adjusted R^2^, the adjusted coefficient of determination. |
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.
R^2^
is a scaladoc format. How about just R^2
? and could you fix in def r2
also
(R^2 would mean XOR in python, so R**2 seems the best to me unless someone knows a better format to use with Sphinx)
edit again, let's just stick with R^2
, I think it's fine here and no one would think it's XOR
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.
sure, I will change.
python/pyspark/ml/regression.py
Outdated
Returns Adjusted R^2^, the adjusted coefficient of determination. | ||
|
||
.. seealso:: `Wikipedia coefficient of determination \ | ||
<https://en.wikipedia.org/wiki/Coefficient_of_determination>` |
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.
use the same link from the scaladoc https://en.wikipedia.org/wiki/Coefficient_of_determination#Adjusted_R2
It also doesn't generate properly, you need a trailing _
I believe (also need to fix def r2
if you don't mind).
it should be:
.. seealso:: `Wikipedia coefficient of determination \
<http://en.wikipedia.org/wiki/Coefficient_of_determination#Adjusted_R2>`_
If you are able to, building the docs to check these is a good idea
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.
ok, done.
Test build #88556 has finished for PR 20842 at commit
|
Looks good! Thanks! |
@tengpeng Thanks a lot.Not sure the Python style test fail is related to my latest code change in regression.py or not. |
python/pyspark/ml/regression.py
Outdated
""" | ||
Returns Adjusted R^2, the adjusted coefficient of determination. | ||
|
||
.. seealso:: `Wikipedia coefficient of determination \ |
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.
It looks like the error was because the link name is the same as above, maybe try Wikipedia coefficient of determination, Adjusted R^2
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.
ok, thanks.
Test build #88597 has finished for PR 20842 at commit
|
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.
LGTM
merged to master, thanks @kevinyu98 ! |
…ionSummary ## What changes were proposed in this pull request? Adding r2adj in LinearRegressionSummary for Python API. ## How was this patch tested? Added unit tests to exercise the api calls for the summary classes in tests.py. Author: Kevin Yu <[email protected]> Closes apache#20842 from kevinyu98/spark-23162.
What changes were proposed in this pull request?
Adding r2adj in LinearRegressionSummary for Python API.
How was this patch tested?
Added unit tests to exercise the api calls for the summary classes in tests.py.