Github user yanboliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/10469#discussion_r50950853
--- Diff: python/pyspark/ml/wrapper.py ---
@@ -82,13 +71,16 @@ def _transfer_params_to_java(self):
pair = self._make_java_param_pair(param, paramMap[param])
self._java_obj.set(pair)
- def _transfer_params_from_java(self):
+ def _transfer_params_from_java(self, withParent=False):
--- End diff --
I try to put setting Param.parent field into load(), and we will add such
code snippet to ```JavaMLReader.load()```:
```Scala
for param in self._instance.params:
value = self._instance._paramMap[param]
self._instance._paramMap.pop(param)
param.parent = self._instance.uid
self._instance._paramMap[param] = value
```
It will first pop elements from the dict and then push new one which I
think is inefficient.
And this code will operate on ```_paramMap``` which is the ML instance's
internal variable.
So I vote to do this work at ```_transfer_params_from_java``` or we can add
a new function there to do the same work. I'm open to hear your thoughts.
@jkbradley
---
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]