WeichenXu123 commented on a change in pull request #28279:
URL: https://github.com/apache/spark/pull/28279#discussion_r412697172
##########
File path: python/pyspark/ml/pipeline.py
##########
@@ -174,6 +174,55 @@ def _to_java(self):
return _java_obj
+ def _make_java_param_pair(self, param, value):
+ """
+ Makes a Java param pair.
+ """
+ sc = SparkContext._active_spark_context
+ param = self._resolveParam(param)
+ java_param = sc._jvm.org.apache.spark.ml.param.Param(param.parent,
param.name, param.doc)
+ if isinstance(value, Params) and hasattr(value, "_to_java"):
+ # Convert JavaEstimator/JavaTransformer object or
Estimator/Transformer object which implements
+ # `_to_java` method (such as OneVsRest, Pipeline object) to java
object
Review comment:
This is why nested pipeline and nested oneVsRest works.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]