srowen commented on a change in pull request #26038: 
[SPARK-29235][ML][Pyspark]Support avgMetrics in read/write of 
CrossValidatorModel
URL: https://github.com/apache/spark/pull/26038#discussion_r336558317
 
 

 ##########
 File path: python/pyspark/ml/tuning.py
 ##########
 @@ -829,13 +850,11 @@ def _to_java(self):
         :return: Java object equivalent to this instance.
         """
 
-        sc = SparkContext._active_spark_context
-        # TODO: persst validation metrics as well
         _java_obj = JavaParams._new_java_obj(
             "org.apache.spark.ml.tuning.TrainValidationSplitModel",
             self.uid,
             self.bestModel._to_java(),
-            _py2java(sc, []))
+            self.validationMetrics)
 
 Review comment:
   This seems fine but out of curiosity why is the `_py2java` call no longer 
needed here?

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to