You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/07/22 06:24:59 UTC

[GitHub] [spark] huaxingao commented on a change in pull request #29159: [SPARK-32310][ML][PySpark][3.0] ML params default value parity

huaxingao commented on a change in pull request #29159:
URL: https://github.com/apache/spark/pull/29159#discussion_r458561691



##########
File path: mllib/src/test/scala/org/apache/spark/ml/util/DefaultReadWriteTest.scala
##########
@@ -64,7 +64,12 @@ trait DefaultReadWriteTest extends TempDirectory { self: Suite =>
             case (Array(values), Array(newValues)) =>
               assert(values === newValues, s"Values do not match on param ${p.name}.")
             case (value, newValue) =>
-              assert(value === newValue, s"Values do not match on param ${p.name}.")
+              if (value.isInstanceOf[Double] && value.asInstanceOf[Double].isNaN) {

Review comment:
       Before my change, this ```setDefault(strategy -> Imputer.mean, missingValue -> Double.NaN)``` is in Imputer. Now I moved this to ImputerParams so ImputerModel also has the default value of ```missingValue``` set to ```Double.NaN```. In ```DefaultReadWriteTest```, it compares the default value of ```missingValue``` in the original model and the loaded model, so I need to make the NaN comparison work.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org