-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-29235][ML][Pyspark]Support avgMetrics in read/write of CrossValidatorModel #26038
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
Conversation
|
Test build #111826 has finished for PR 26038 at commit
|
|
Test build #111827 has finished for PR 26038 at commit
|
|
cc @zhengruifeng Kindly review |
@shahidki31 Same issue also exist in |
|
Thanks @zhengruifeng I will add metrics for |
|
If you'll make the changes @shahidki31 I think we can merge this. |
|
Thanks @srowen . I will update it today. Actually, there seems an issue. I think |
|
Test build #112229 has finished for PR 26038 at commit
|
5e39d5a to
b0f1975
Compare
|
Test build #112234 has finished for PR 26038 at commit
|
|
Test build #112235 has finished for PR 26038 at commit
|
|
Updated the PR. Locally verified. |
|
Test build #112232 has finished for PR 26038 at commit
|
|
Test build #112233 has finished for PR 26038 at commit
|
|
retest this please |
|
Test build #112240 has finished for PR 26038 at commit
|
|
Test build #112241 has finished for PR 26038 at commit
|
python/pyspark/ml/tuning.py
Outdated
| self.uid, | ||
| self.bestModel._to_java(), | ||
| _py2java(sc, [])) | ||
| self.validationMetrics) |
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.
This seems fine but out of curiosity why is the _py2java call no longer needed here?
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 think we will be converting _py2java here?
spark/python/pyspark/ml/wrapper.py
Lines 60 to 69 in 9e42c52
| def _new_java_obj(java_class, *args): | |
| """ | |
| Returns a new Java object. | |
| """ | |
| sc = SparkContext._active_spark_context | |
| java_obj = _jvm() | |
| for name in java_class.split("."): | |
| java_obj = getattr(java_obj, name) | |
| java_args = [_py2java(sc, arg) for arg in args] | |
| return java_obj(*java_args) |
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 compared with _py2java here and without here, both cases the written metadata file is same. I'll add _py2java here, for consistency.
|
Test build #112292 has finished for PR 26038 at commit
|
|
Merged to master |
|
Thanks @srowen @zhengruifeng |
What changes were proposed in this pull request?
Currently pyspark doesn't write/read
avgMetricsinCrossValidatorModel, whereas scala supports it.Why are the changes needed?
Test step to reproduce it:
Does this PR introduce any user-facing change?
No
How was this patch tested?
Manually tested
Before patch:
After patch: